diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2015-07-25 08:20:18 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2015-07-25 08:20:18 +0200 |
commit | b99a6307051d00d9fcece0588d382e2fb62c193f (patch) | |
tree | c7a00ebeae8b565ea2383bf3a7159b5a7c9b068e /src/gui/gui-input.c | |
parent | 24c53b4c3fb05d9e1adf0783a0f226a86e6d0d7c (diff) | |
download | weechat-b99a6307051d00d9fcece0588d382e2fb62c193f.zip |
core: allow execution of command "/input return" on a buffer which is not displayed in a window
Diffstat (limited to 'src/gui/gui-input.c')
-rw-r--r-- | src/gui/gui-input.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c index a913c3642..2b46cb16a 100644 --- a/src/gui/gui-input.c +++ b/src/gui/gui-input.c @@ -406,7 +406,6 @@ gui_input_clipboard_paste (struct t_gui_buffer *buffer) void gui_input_return (struct t_gui_buffer *buffer) { - struct t_gui_window *window; char *command; if (CONFIG_BOOLEAN(config_look_bare_display_exit_on_input) @@ -415,29 +414,26 @@ gui_input_return (struct t_gui_buffer *buffer) gui_window_bare_display_toggle (NULL); } - window = gui_window_search_with_buffer (buffer); - if (window && window->buffer->input - && (window->buffer->input_buffer_size > 0)) + if (buffer->input && (buffer->input_buffer_size > 0)) { - window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0'; - command = strdup (window->buffer->input_buffer); + buffer->input_buffer[buffer->input_buffer_size] = '\0'; + command = strdup (buffer->input_buffer); if (command) { - gui_history_add (window->buffer, - window->buffer->input_buffer); - window->buffer->input_buffer[0] = '\0'; - window->buffer->input_buffer_size = 0; - window->buffer->input_buffer_length = 0; - window->buffer->input_buffer_pos = 0; - window->buffer->input_buffer_1st_display = 0; - gui_buffer_undo_free_all (window->buffer); - window->buffer->ptr_history = NULL; + gui_history_add (buffer, buffer->input_buffer); + buffer->input_buffer[0] = '\0'; + buffer->input_buffer_size = 0; + buffer->input_buffer_length = 0; + buffer->input_buffer_pos = 0; + buffer->input_buffer_1st_display = 0; + gui_buffer_undo_free_all (buffer); + buffer->ptr_history = NULL; gui_history_ptr = NULL; - gui_input_optimize_size (window->buffer); - gui_input_text_changed_modifier_and_signal (window->buffer, + gui_input_optimize_size (buffer); + gui_input_text_changed_modifier_and_signal (buffer, 0, /* save undo */ 1); /* stop completion */ - (void) input_data (window->buffer, command); + (void) input_data (buffer, command); free (command); } } |