diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2020-05-10 00:01:37 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-05-10 00:10:38 +0200 |
commit | 867e07aa18598ed04abddc342f8e73a3ac61c0bc (patch) | |
tree | 17f0ceb4fd05a5538da85ff76c7989bde4cf7982 /src/gui | |
parent | 09f4f98ad98c778bfe5cc2a6c6953ad6bc2b6c30 (diff) | |
download | weechat-867e07aa18598ed04abddc342f8e73a3ac61c0bc.zip |
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.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui-bar-item.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c index b7fda83ff..b2382a567 100644 --- a/src/gui/gui-bar-item.c +++ b/src/gui/gui-bar-item.c @@ -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; |