mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 23:36:37 +02:00
core: properly display newlines in input for all buffers
Supporting multiple lines in the input bar is useful even for buffers without input_multiline set, because it enables you to compose multiple lines at once, even if it is sent as multiple messages. It is particularly useful when you paste multiple lines and want to edit some of it before you send the message.
This commit is contained in:
committed by
Sébastien Helleu
parent
09f4f98ad9
commit
867e07aa18
+7
-10
@@ -964,18 +964,15 @@ gui_bar_item_input_text_cb (const void *pointer, void *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* if multiline is enabled in buffer, transform '\n' to '\r' to the
|
||||
* newlines are displayed as real new lines instead of spaces
|
||||
* transform '\n' to '\r' so the newlines are displayed as real new lines
|
||||
* instead of spaces
|
||||
*/
|
||||
if (buffer->input_multiline)
|
||||
ptr_input2 = ptr_input;
|
||||
while (ptr_input2 && ptr_input2[0])
|
||||
{
|
||||
ptr_input2 = ptr_input;
|
||||
while (ptr_input2 && ptr_input2[0])
|
||||
{
|
||||
if (ptr_input2[0] == '\n')
|
||||
ptr_input2[0] = '\r';
|
||||
ptr_input2 = (char *)utf8_next_char (ptr_input2);
|
||||
}
|
||||
if (ptr_input2[0] == '\n')
|
||||
ptr_input2[0] = '\r';
|
||||
ptr_input2 = (char *)utf8_next_char (ptr_input2);
|
||||
}
|
||||
|
||||
return ptr_input;
|
||||
|
||||
Reference in New Issue
Block a user