[gnome-text-editor] spellcheck: invalidate after adding/ignoring words



commit cee97b77b8e1bccda7d6ba18020be55030156d41
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jul 16 19:59:17 2021 -0700

    spellcheck: invalidate after adding/ignoring words

 src/editor-document.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/editor-document.c b/src/editor-document.c
index f7bd274..1f58e2a 100644
--- a/src/editor-document.c
+++ b/src/editor-document.c
@@ -1848,7 +1848,10 @@ _editor_document_add_spelling (EditorDocument *self,
   g_return_if_fail (EDITOR_IS_DOCUMENT (self));
 
   if (self->spell_checker != NULL)
-    editor_spell_checker_add_word (self->spell_checker, word);
+    {
+      editor_spell_checker_add_word (self->spell_checker, word);
+      editor_text_buffer_spell_adapter_invalidate_all (self->spell_adapter);
+    }
 }
 
 void
@@ -1858,5 +1861,8 @@ _editor_document_ignore_spelling (EditorDocument *self,
   g_return_if_fail (EDITOR_IS_DOCUMENT (self));
 
   if (self->spell_checker != NULL)
-    editor_spell_checker_ignore_word (self->spell_checker, word);
+    {
+      editor_spell_checker_ignore_word (self->spell_checker, word);
+      editor_text_buffer_spell_adapter_invalidate_all (self->spell_adapter);
+    }
 }


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