diff options
| author | Maxime Coste <mawww@kakoune.org> | 2016-12-07 13:43:27 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2016-12-07 13:43:27 +0000 |
| commit | 1383614a5fae9f8cd8e3adc923b5ae71e7e372fa (patch) | |
| tree | 24efd0fa1f4cf04d1f9208c4b641e70d208e254b /src/display_buffer.cc | |
| parent | 2f704eab160907b388f2d373873912d4a7e7eb02 (diff) | |
Fix markup parsing handling of antislash escapes
Antislashes did not need to immediately precede a face spec to
escape it, it could be in any characters before it.
Diffstat (limited to 'src/display_buffer.cc')
| -rw-r--r-- | src/display_buffer.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/display_buffer.cc b/src/display_buffer.cc index 4ac6a2fb..cd7468d9 100644 --- a/src/display_buffer.cc +++ b/src/display_buffer.cc @@ -316,8 +316,14 @@ DisplayLine parse_display_line(StringView line) it = closing; pos = closing + 1; } - was_antislash = false; } + if (c == '\n') // line breaks are forbidden, replace with space + { + content += StringView{pos, it+1}; + content.back() = ' '; + pos = it + 1; + } + if (c == '\\') { if (was_antislash) @@ -329,13 +335,8 @@ DisplayLine parse_display_line(StringView line) else was_antislash = true; } - if (c == '\n') // line breaks are forbidden, replace with space - { - content += StringView{pos, it+1}; - content.back() = ' '; - pos = it + 1; + else was_antislash = false; - } } content += StringView{pos, line.end()}; if (not content.empty()) |
