From 867e07aa18598ed04abddc342f8e73a3ac61c0bc Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sun, 10 May 2020 00:01:37 +0200 Subject: [PATCH] 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. --- src/gui/gui-bar-item.c | 17 +++++++---------- 1 file 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;