Do not undo on failed reload, it's not needed anymore
This commit is contained in:
parent
8e745ef9d8
commit
ba0fcbb9cc
@ -603,33 +603,17 @@ moo_edit_reload_local (MooEdit *edit,
|
||||
const char *encoding,
|
||||
GError **error)
|
||||
{
|
||||
GtkTextIter start, end;
|
||||
GtkTextBuffer *buffer;
|
||||
gboolean result, enable_highlight;
|
||||
gboolean result;
|
||||
GFile *file;
|
||||
|
||||
file = moo_edit_get_file (edit);
|
||||
moo_return_error_if_fail (G_IS_FILE (file));
|
||||
|
||||
buffer = moo_edit_get_buffer (edit);
|
||||
|
||||
block_buffer_signals (edit);
|
||||
gtk_text_buffer_begin_user_action (buffer);
|
||||
|
||||
gtk_text_buffer_get_bounds (buffer, &start, &end);
|
||||
gtk_text_buffer_delete (buffer, &start, &end);
|
||||
g_object_get (buffer, "highlight-syntax", &enable_highlight, (char*) 0);
|
||||
g_object_set (buffer, "highlight-syntax", FALSE, (char*) 0);
|
||||
|
||||
result = _moo_edit_load_file (edit, file,
|
||||
encoding ? encoding : edit->priv->encoding,
|
||||
NULL,
|
||||
error);
|
||||
|
||||
g_object_set (buffer, "highlight-syntax", enable_highlight, (char*) 0);
|
||||
gtk_text_buffer_end_user_action (buffer);
|
||||
unblock_buffer_signals (edit);
|
||||
|
||||
if (result)
|
||||
{
|
||||
edit->priv->status = (MooEditStatus) 0;
|
||||
|
@ -2507,7 +2507,6 @@ moo_editor_reload (MooEditor *editor,
|
||||
{
|
||||
guint i;
|
||||
GError *error_here = NULL;
|
||||
MooEditView *active_view;
|
||||
MooEditViewArray *views = NULL;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
@ -2544,7 +2543,6 @@ moo_editor_reload (MooEditor *editor,
|
||||
}
|
||||
|
||||
views = moo_edit_get_views (doc);
|
||||
active_view = moo_edit_get_view (doc);
|
||||
|
||||
for (i = 0; i < moo_edit_view_array_get_size (views); ++i)
|
||||
{
|
||||
@ -2573,7 +2571,6 @@ moo_editor_reload (MooEditor *editor,
|
||||
|
||||
g_propagate_error (error, error_here);
|
||||
|
||||
moo_text_view_undo (MOO_TEXT_VIEW (active_view));
|
||||
g_object_set_data (G_OBJECT (doc), "moo-scroll-to", NULL);
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user