[gnome-builder/gnome-builder-3-28] buffers: backport highlight disable while loading
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-28] buffers: backport highlight disable while loading
- Date: Thu, 2 Aug 2018 17:52:47 +0000 (UTC)
commit 14380d0362bd92a68884c831d6316a87f790cd4e
Author: Christian Hergert <chergert redhat com>
Date: Thu Aug 2 10:51:41 2018 -0700
buffers: backport highlight disable while loading
This disables highlighting while we load the buffer to avoid some work
and potential races in gtksourceview.
src/libide/buffers/ide-buffer-manager.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/src/libide/buffers/ide-buffer-manager.c b/src/libide/buffers/ide-buffer-manager.c
index 3e7fe2594..52ae571dd 100644
--- a/src/libide/buffers/ide-buffer-manager.c
+++ b/src/libide/buffers/ide-buffer-manager.c
@@ -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,
G_PRIORITY_LOW,
cancellable,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]