[gnome-text-editor] statusbar: short-circuit when loading



commit ca72a5c61af97b12b4f640970a8e959f386fb251
Author: Christian Hergert <chergert redhat com>
Date:   Mon Aug 1 12:32:09 2022 -0700

    statusbar: short-circuit when loading
    
    We don't need to update the status bar while the document is loading, we
    can handle it during the signal emission afterwards.
    
    Related #444

 src/editor-statusbar.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/editor-statusbar.c b/src/editor-statusbar.c
index 859c11f..9d60782 100644
--- a/src/editor-statusbar.c
+++ b/src/editor-statusbar.c
@@ -21,6 +21,7 @@
 #include "config.h"
 
 #include "editor-binding-group.h"
+#include "editor-document-private.h"
 #include "editor-page-private.h"
 #include "editor-signal-group.h"
 #include "editor-statusbar-private.h"
@@ -69,6 +70,9 @@ editor_statusbar_cursor_moved_cb (EditorStatusbar *self,
   g_assert (EDITOR_IS_STATUSBAR (self));
   g_assert (EDITOR_IS_DOCUMENT (document));
 
+  if (_editor_document_get_loading (document))
+    return;
+
   if (gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (document), &begin, &end))
     {
       gtk_text_iter_order (&begin, &end);


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