diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2020-05-09 18:23:33 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-05-09 18:23:33 +0200 |
commit | f987e445ec173b8c033833feb25053e358260e49 (patch) | |
tree | dffbd5d63dc59ff77ecf6d7a30571b4fcc1ded3a | |
parent | 63714855d3cbedc49747b099533a5a259cbd74c2 (diff) | |
download | weechat-f987e445ec173b8c033833feb25053e358260e49.zip |
core: properly display newlines in input when multiline is enabled in buffer (issue #984, issue #1063)
-rw-r--r-- | src/gui/gui-bar-item.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c index 505b784ef..b7fda83ff 100644 --- a/src/gui/gui-bar-item.c +++ b/src/gui/gui-bar-item.c @@ -963,6 +963,21 @@ 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 + */ + if (buffer->input_multiline) + { + 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); + } + } + return ptr_input; } |