[gnome-text-editor] spellcheck: dont check while document is busy



commit bfccdf10db7a75238dd6e1ed4e58de4885e7811d
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 5 16:56:57 2021 -0700

    spellcheck: dont check while document is busy
    
    We don't want to collide with updating the document for syntax highlighting
    as that can affect no-spell-check regions.

 src/editor-text-buffer-spell-adapter.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/editor-text-buffer-spell-adapter.c b/src/editor-text-buffer-spell-adapter.c
index 4c362c6..94e05b3 100644
--- a/src/editor-text-buffer-spell-adapter.c
+++ b/src/editor-text-buffer-spell-adapter.c
@@ -22,6 +22,7 @@
 
 #include "cjhtextregionprivate.h"
 
+#include "editor-document.h"
 #include "editor-spell-checker.h"
 #include "editor-spell-cursor.h"
 #include "editor-spell-language.h"
@@ -143,6 +144,10 @@ editor_text_buffer_spell_adapter_update_range (EditorTextBufferSpellAdapter *sel
   if (!scan_for_next_unchecked (self->region, begin_offset, end_offset, &position))
     return FALSE;
 
+  /* Ignore while we are loading or saving */
+  if (editor_document_get_busy (EDITOR_DOCUMENT (self->buffer)))
+    return TRUE;
+
   gtk_text_buffer_get_iter_at_mark (self->buffer, &insert,
                                     gtk_text_buffer_get_insert (self->buffer));
   gtk_text_buffer_get_iter_at_offset (self->buffer, &begin, position);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]