diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-08-29 10:01:43 +0700 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-08-29 10:01:43 +0700 |
| commit | 1709886873b9c655ca0183a0711adf61709bb29f (patch) | |
| tree | 1b24c7631ad7d9af8a8fc5ce7656bcbcdcbbe4d8 /src/display_buffer.cc | |
| parent | 24234dffa3035a471126173d478d5ae215fb620e (diff) | |
avoid literal eol in status lines, replace them with another symbol
Diffstat (limited to 'src/display_buffer.cc')
| -rw-r--r-- | src/display_buffer.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/display_buffer.cc b/src/display_buffer.cc index 3694839a..e6ae2a34 100644 --- a/src/display_buffer.cc +++ b/src/display_buffer.cc @@ -303,4 +303,22 @@ DisplayLine parse_display_line(StringView line, const HashMap<String, DisplayLin return res; } +String fix_atom_text(StringView str) +{ + String res; + auto pos = str.begin(); + for (auto it = str.begin(), end = str.end(); it != end; ++it) + { + char c = *it; + if (c == '\n' or c == '\r') + { + res += StringView{pos, it}; + res += c == '\n' ? "" : "␍"; + pos = it+1; + } + } + res += StringView{pos, str.end()}; + return res; +} + } |
