Don't observe input change in completion mode.
authorDaniel Carl <danielcarl@gmx.de>
Sat, 28 Sep 2013 23:24:06 +0000 (01:24 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Sat, 28 Sep 2013 23:24:06 +0000 (01:24 +0200)
This patch prevents slow and unsmooth completions caused by logic that
observes the change content in the inputbox. This was the case mainly for the
search completion, every step in the completion list started a new search.

src/mode.c

index ae79ad2..a1b2b4d 100644 (file)
@@ -137,6 +137,10 @@ void mode_input_changed(GtkTextBuffer* buffer, gpointer data)
 {
     char *text;
     GtkTextIter start, end;
+    /* don't observe changes in completion mode */
+    if (vb.mode->flags & FLAG_COMPLETION) {
+        return;
+    }
     /* don't process changes not typed by the user */
     if (gtk_widget_is_focus(vb.gui.input) && vb.mode && vb.mode->input_changed) {
         gtk_text_buffer_get_bounds(buffer, &start, &end);