[gtksourceview/gtksourceview-5-4] completion: avoid updates before visible row



commit 945f01d6e73a1a10ec9346fd29230b51b220b859
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jun 11 20:35:54 2022 -0700

    completion: avoid updates before visible row
    
    But only when the offset will not change (added == removed).

 gtksourceview/gtksourcecompletionlistbox.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletionlistbox.c b/gtksourceview/gtksourcecompletionlistbox.c
index b525c4f8..67531858 100644
--- a/gtksourceview/gtksourcecompletionlistbox.c
+++ b/gtksourceview/gtksourcecompletionlistbox.c
@@ -1075,9 +1075,14 @@ gtk_source_completion_list_box_items_changed_cb (GtkSourceCompletionListBox *sel
 
        offset = gtk_source_completion_list_box_get_offset (self);
 
-       /* Skip widget resize if results are after visible area */
-       if (position >= offset + self->n_rows)
+       /* Skip widget resize if results are out of view and wont force our
+        * current results down.
+        */
+       if ((position >= offset + self->n_rows) ||
+           (removed == added && (position + added) < offset))
+       {
                return;
+       }
 
        gtk_source_completion_list_box_queue_update (self);
 }


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