[gnome-text-editor] document: emit cursor-moved when busy count reaches zero



commit 4265e650dd2f44224903392e6e7dce27dc0248cb
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jul 28 17:16:14 2021 -0700

    document: emit cursor-moved when busy count reaches zero
    
    This is helpful so that other places in the codebase can ignore work when
    the document is busy as it will get a cursor-moved emission immediately
    after loading has completed.

 src/editor-document.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/editor-document.c b/src/editor-document.c
index 9fee11e..219cac0 100644
--- a/src/editor-document.c
+++ b/src/editor-document.c
@@ -1022,6 +1022,11 @@ _editor_document_unmark_busy (EditorDocument *self)
     {
       g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_BUSY]);
       editor_buffer_monitor_unpause (self->monitor);
+      /* Now that we are not busy, emit cursor-moved so that anything that
+       * wants to watch the cursor position can safely ignore changes while
+       * the document is busy.
+       */
+      g_signal_emit_by_name (self, "cursor-moved");
     }
 }
 


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