[gnome-text-editor] spellcheck: udpate after setting buffer
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor] spellcheck: udpate after setting buffer
- Date: Fri, 25 Jun 2021 23:57:44 +0000 (UTC)
commit 574f4461ecd25e6b030e21ab511607ca0bc2d292
Author: Christian Hergert <chergert redhat com>
Date: Fri Jun 25 16:53:26 2021 -0700
spellcheck: udpate after setting buffer
src/editor-text-buffer-spell-adapter.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/editor-text-buffer-spell-adapter.c b/src/editor-text-buffer-spell-adapter.c
index 39e16d9..a01175b 100644
--- a/src/editor-text-buffer-spell-adapter.c
+++ b/src/editor-text-buffer-spell-adapter.c
@@ -103,8 +103,11 @@ editor_text_buffer_spell_adapter_queue_update (EditorTextBufferSpellAdapter *sel
{
g_assert (EDITOR_IS_TEXT_BUFFER_SPELL_ADAPTER (self));
- if (self->checker == NULL)
- return;
+ if (self->checker == NULL || self->buffer == NULL)
+ {
+ g_clear_handle_id (&self->update_source, g_source_remove);
+ return;
+ }
if (self->update_source == 0)
self->update_source = g_timeout_add_full (G_PRIORITY_LOW,
@@ -133,6 +136,8 @@ editor_text_buffer_spell_adapter_set_buffer (EditorTextBufferSpellAdapter *self,
length = gtk_text_iter_get_offset (&end) - offset;
_cjh_text_region_insert (self->region, offset, length, UNCHECKED);
+
+ editor_text_buffer_spell_adapter_queue_update (self);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]