mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 04:16:38 +02:00
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.
This commit is contained in:
committed by
Sébastien Helleu
parent
8fe4c84b72
commit
cfaf68ae61
@@ -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)
|
||||
pos = gui_key_buffer_search (0, -1, GUI_KEY_BRACKETED_PASTE_START);
|
||||
if (pos >= 0)
|
||||
{
|
||||
/* 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 ();
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user