diff --git a/src/gui/curses/gui-curses-key.c b/src/gui/curses/gui-curses-key.c
index 15b0bb8..706d033 100644
--- a/src/gui/curses/gui-curses-key.c
+++ b/src/gui/curses/gui-curses-key.c
@@ -420,7 +420,7 @@ gui_key_flush (int paste)
                 gui_input_insert_string (gui_current_window->buffer,
                                          key_str, -1);
                 if (gui_current_window->buffer->completion)
-                    gui_completion_stop (gui_current_window->buffer->completion, 0);
+                    gui_completion_stop (gui_current_window->buffer->completion, 1);
                 gui_input_text_changed_modifier_and_signal (gui_current_window->buffer,
                                                             (!paste || !undo_done) ? 1 : 0);
                 undo_done = 1;
diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c
index 535b849..71cab71 100644
--- a/src/gui/gui-input.c
+++ b/src/gui/gui-input.c
@@ -82,7 +82,7 @@ gui_input_optimize_size (struct t_gui_buffer *buffer)
 }
 
 /*
- * Replaces full input by another string, trying to keep cursor position is new
+ * Replaces full input by another string, trying to keep cursor position if new
  * string is long enough.
  */
 
@@ -319,6 +319,10 @@ gui_input_move_to_buffer (struct t_gui_buffer *from_buffer,
     from_buffer->last_input_undo = NULL;
     from_buffer->ptr_input_undo = NULL;
     from_buffer->input_undo_count = 0;
+
+    if (from_buffer->completion)
+        gui_completion_stop (from_buffer->completion, 1);
+
 }
 
 /*
@@ -1171,6 +1175,7 @@ gui_input_history_local_previous (struct t_gui_buffer *buffer)
     window = gui_window_search_with_buffer (buffer);
     if (window)
     {
+        gui_completion_stop (window->buffer->completion, 1);
         gui_input_history_previous (window,
                                     window->buffer->history,
                                     &(window->buffer->ptr_history));
@@ -1189,6 +1194,7 @@ gui_input_history_local_next (struct t_gui_buffer *buffer)
     window = gui_window_search_with_buffer (buffer);
     if (window)
     {
+        gui_completion_stop (window->buffer->completion, 1);
         gui_input_history_next (window,
                                 window->buffer->history,
                                 &(window->buffer->ptr_history));
@@ -1207,6 +1213,7 @@ gui_input_history_global_previous (struct t_gui_buffer *buffer)
     window = gui_window_search_with_buffer (buffer);
     if (window)
     {
+        gui_completion_stop (window->buffer->completion, 1);
         gui_input_history_previous (window,
                                     gui_history,
                                     &gui_history_ptr);
@@ -1225,6 +1232,7 @@ gui_input_history_global_next (struct t_gui_buffer *buffer)
     window = gui_window_search_with_buffer (buffer);
     if (window)
     {
+        gui_completion_stop (window->buffer->completion, 1);
         gui_input_history_next (window,
                                 gui_history,
                                 &gui_history_ptr);
