diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-09-20 11:23:10 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-09-20 11:23:10 +0100 |
| commit | b3e0e27d1fc295ab14ab0855bca4fcfe71d0ad49 (patch) | |
| tree | 142cea02e3cc4ae6b9a5917ce90d55d01a719b09 /src/display_buffer.cc | |
| parent | 574e3371320a809aa584d9d8b47fa31d3d675728 (diff) | |
Do not allow '\n' in display lines, replace with a space
Diffstat (limited to 'src/display_buffer.cc')
| -rw-r--r-- | src/display_buffer.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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()) |
