mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
core: Always remove final newline when pasting
Since pasting doesn't send the line now, it's more practical to always remove the final newline so you don't end up with an empty line at the end of the input buffer. Fixes a part of #1498
This commit is contained in:
committed by
Sébastien Helleu
parent
37decf3a7c
commit
68040f210a
+3
-4
@@ -2802,19 +2802,18 @@ gui_key_buffer_remove (int index, int number)
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes final newline at end of paste if there is only one line to paste.
|
||||
* Removes final newline at end of paste.
|
||||
*/
|
||||
|
||||
void
|
||||
gui_key_paste_remove_newline ()
|
||||
{
|
||||
if ((gui_key_paste_lines <= 1)
|
||||
&& (gui_key_buffer_size > 0)
|
||||
if ((gui_key_buffer_size > 0)
|
||||
&& ((gui_key_buffer[gui_key_buffer_size - 1] == '\r')
|
||||
|| (gui_key_buffer[gui_key_buffer_size - 1] == '\n')))
|
||||
{
|
||||
gui_key_buffer_size--;
|
||||
gui_key_paste_lines = 0;
|
||||
gui_key_paste_lines--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user