diff options
-rw-r--r-- | src/gui/gui-input.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c index 0eab02e4f..62be98201 100644 --- a/src/gui/gui-input.c +++ b/src/gui/gui-input.c @@ -1109,6 +1109,12 @@ gui_input_history_next (struct t_gui_window *window, if (*ptr_history) { + /* replace text in history with current input */ + window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0'; + if ((*ptr_history)->text) + free ((*ptr_history)->text); + (*ptr_history)->text = strdup (window->buffer->input_buffer); + *ptr_history = (*ptr_history)->prev_history; if (*ptr_history) { |