From 585681e5a075abf07fb465ac8865a4f210bbd1cb Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 1 Jul 2007 11:20:34 +0000 Subject: Down key now saves input to history and clears input line (task #7049) --- src/gui/gui-action.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/gui/gui-action.c b/src/gui/gui-action.c index 9e4c85328..0db9e7ffd 100644 --- a/src/gui/gui-action.c +++ b/src/gui/gui-action.c @@ -859,6 +859,23 @@ gui_action_down (t_gui_window *window, char *args) } gui_input_draw (window->buffer, 0); } + else + { + /* add line to history then clear input */ + if (window->buffer->input_buffer_size > 0) + { + window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0'; + window->buffer->input_buffer_color_mask[window->buffer->input_buffer_size] = '\0'; + history_buffer_add (window->buffer, window->buffer->input_buffer); + history_global_add (window->buffer->input_buffer); + window->buffer->input_buffer_size = 0; + window->buffer->input_buffer_length = 0; + gui_input_optimize_size (window->buffer); + window->buffer->input_buffer_pos = 0; + window->buffer->input_buffer_1st_display = 0; + gui_input_draw (window->buffer, 0); + } + } } else { -- cgit debian/1.2.3+git2.25.1-1-2-gaceb0