From: Daniel Carl <danielcarl@gmx.de>
Date: Sat, 28 Sep 2013 23:24:06 +0000 (+0200)
Subject: Don't observe input change in completion mode.
X-Git-Url: https://git.owens.tech/assets/wrapped.html/assets/wrapped.html/git?a=commitdiff_plain;h=f24a8ec1c9fb6812232fb5cfd770830e348fabe0;p=vimb.git

Don't observe input change in completion mode.

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.
---

diff --git a/src/mode.c b/src/mode.c
index ae79ad2..a1b2b4d 100644
--- a/src/mode.c
+++ b/src/mode.c
@@ -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);