Commit 14380d03 authored by Christian Hergert's avatar Christian Hergert

buffers: backport highlight disable while loading

This disables highlighting while we load the buffer to avoid some work
and potential races in gtksourceview.
parent f57424c3
......@@ -78,6 +78,7 @@ typedef struct
IdeProgress *progress;
GtkSourceFileLoader *loader;
guint is_new : 1;
guint rehighlight : 1;
IdeWorkbenchOpenFlags flags;
guint line;
guint line_offset;
......@@ -609,6 +610,8 @@ ide_buffer_manager_load_file__load_cb (GObject *object,
gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (state->buffer), FALSE);
gtk_source_buffer_set_highlight_syntax (GTK_SOURCE_BUFFER (state->buffer), state->rehighlight);
if (state->is_new)
ide_buffer_manager_track_buffer (self, state->buffer);
......@@ -743,6 +746,9 @@ ide_buffer_manager__load_file_query_info_cb (GObject *object,
cancellable = g_task_get_cancellable (task);
state->rehighlight = gtk_source_buffer_get_highlight_syntax (GTK_SOURCE_BUFFER (state->buffer));
gtk_source_buffer_set_highlight_syntax (GTK_SOURCE_BUFFER (state->buffer), FALSE);
gtk_source_file_loader_load_async (state->loader,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment