diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2020-10-11 15:03:53 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-25 18:53:12 +0100 |
commit | cfaf68ae6172cf37c50d3aaac7ab4e88fa80c8ef (patch) | |
tree | c1dff30fc8739bacb8199e20ab1ed7b489c6405a /src | |
parent | 8fe4c84b727972d44a7b11e6a1f52d50bbc004c7 (diff) | |
download | weechat-cfaf68ae6172cf37c50d3aaac7ab4e88fa80c8ef.zip |
core: Parse bracketed paste also when paste pending
When in paste pending mode, the bracketed paste escape sequence should
still be interpreted, so that if you paste while in paste pending the
same things as when pasting in normal mode still happens, i.e. the
escape sequence is removed, ctrl-y/n is not interpreted and newline/tabs
are replaced.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/curses/gui-curses-key.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/gui/curses/gui-curses-key.c b/src/gui/curses/gui-curses-key.c index d1ccefd8d..746a93c7a 100644 --- a/src/gui/curses/gui-curses-key.c +++ b/src/gui/curses/gui-curses-key.c @@ -524,37 +524,37 @@ gui_key_read_cb (const void *pointer, void *data, int fd) } } - if (gui_key_paste_pending) + if (!gui_key_paste_bracketed) { - if (accept_paste) - { - /* user is OK for pasting text, let's paste! */ - gui_key_paste_accept (); - } - else if (cancel_paste) - { - /* user doesn't want to paste text: clear whole buffer! */ - gui_key_paste_cancel (); - } - else if (text_added_to_buffer) + pos = gui_key_buffer_search (0, -1, GUI_KEY_BRACKETED_PASTE_START); + if (pos >= 0) { - /* new text received while asking for paste, update message */ - gui_input_paste_pending_signal (); + gui_key_buffer_remove (pos, GUI_KEY_BRACKETED_PASTE_LENGTH); + gui_key_paste_bracketed_start (); } } - else + + if (!gui_key_paste_bracketed) { - if (!gui_key_paste_bracketed) + if (gui_key_paste_pending) { - pos = gui_key_buffer_search (0, -1, GUI_KEY_BRACKETED_PASTE_START); - if (pos >= 0) + if (accept_paste) { - gui_key_buffer_remove (pos, GUI_KEY_BRACKETED_PASTE_LENGTH); - gui_key_paste_bracketed_start (); + /* user is OK for pasting text, let's paste! */ + gui_key_paste_accept (); + } + else if (cancel_paste) + { + /* user doesn't want to paste text: clear whole buffer! */ + gui_key_paste_cancel (); + } + else if (text_added_to_buffer) + { + /* new text received while asking for paste, update message */ + gui_input_paste_pending_signal (); } } - - if (!gui_key_paste_bracketed) + else gui_key_paste_check (0); } |