From b3e0e27d1fc295ab14ab0855bca4fcfe71d0ad49 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 20 Sep 2015 11:23:10 +0100 Subject: [PATCH] Do not allow '\n' in display lines, replace with a space --- src/display_buffer.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/display_buffer.cc b/src/display_buffer.cc index 0a1b3503..3bf2f1b4 100644 --- a/src/display_buffer.cc +++ b/src/display_buffer.cc @@ -296,6 +296,13 @@ DisplayLine parse_display_line(StringView line, Face default_face) else was_antislash = true; } + if (c == '\n') // line breaks are forbidden, replace with space + { + content += StringView{pos, it+1}; + content.back() = ' '; + pos = it + 1; + was_antislash = false; + } } content += StringView{pos, line.end()}; if (not content.empty())