[gnome-text-editor] spellcheck: disable spellcheck for now



commit d41083f1cf02e49b6b77345595193a613679bb51
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jun 25 17:55:29 2021 -0700

    spellcheck: disable spellcheck for now
    
    Until we get the rest of the plumbing into place.

 src/editor-document.c                  | 4 ++--
 src/editor-text-buffer-spell-adapter.c | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/editor-document.c b/src/editor-document.c
index 96ba399..3004998 100644
--- a/src/editor-document.c
+++ b/src/editor-document.c
@@ -330,6 +330,8 @@ editor_document_constructed (GObject *object)
 
   G_OBJECT_CLASS (editor_document_parent_class)->constructed (object);
 
+  self->spell_adapter = editor_text_buffer_spell_adapter_new (GTK_TEXT_BUFFER (self),
+                                                              self->spell_checker);
   self->line_spacing_tag = gtk_text_buffer_create_tag (GTK_TEXT_BUFFER (self),
                                                        NULL,
                                                        "pixels-below-lines", 2,
@@ -480,8 +482,6 @@ editor_document_init (EditorDocument *self)
   self->file = gtk_source_file_new ();
   self->draft_id = g_uuid_string_random ();
   self->spell_checker = editor_spell_checker_new (NULL, NULL);
-  self->spell_adapter = editor_text_buffer_spell_adapter_new (GTK_TEXT_BUFFER (self),
-                                                              self->spell_checker);
 
   self->monitor = editor_buffer_monitor_new ();
   g_signal_connect_object (self->monitor,
diff --git a/src/editor-text-buffer-spell-adapter.c b/src/editor-text-buffer-spell-adapter.c
index e412eb6..e225854 100644
--- a/src/editor-text-buffer-spell-adapter.c
+++ b/src/editor-text-buffer-spell-adapter.c
@@ -53,6 +53,8 @@ struct _EditorTextBufferSpellAdapter
   guint               cursor_position;
 
   guint               update_source;
+
+  guint               enabled : 1;
 };
 
 G_DEFINE_TYPE (EditorTextBufferSpellAdapter, editor_text_buffer_spell_adapter, G_TYPE_OBJECT)
@@ -185,7 +187,7 @@ editor_text_buffer_spell_adapter_queue_update (EditorTextBufferSpellAdapter *sel
 {
   g_assert (EDITOR_IS_TEXT_BUFFER_SPELL_ADAPTER (self));
 
-  if (self->checker == NULL || self->buffer == NULL)
+  if (self->checker == NULL || self->buffer == NULL || !self->enabled)
     {
       g_clear_handle_id (&self->update_source, g_source_remove);
       return;


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