summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-10-03 23:21:07 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-10-03 23:21:07 +0200
commit9206036233dbfa2dc8ef6d6cd6f43e1bab560e79 (patch)
tree87a277239ce9d9b893d8c3d360f4ed8561d14075
parentirc: fix crash on malformed irc notice received (without message after target) (diff)
downloadweechat-9206036233dbfa2dc8ef6d6cd6f43e1bab560e79.tar.xz
weechat-9206036233dbfa2dc8ef6d6cd6f43e1bab560e79.zip
core: update text in command history when pressing (ctrl-)up
-rw-r--r--src/gui/gui-input.c6
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)
{