summaryrefslogtreecommitdiff
path: root/src/display_buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-08-29 10:01:43 +0700
committerMaxime Coste <mawww@kakoune.org>2017-08-29 10:01:43 +0700
commit1709886873b9c655ca0183a0711adf61709bb29f (patch)
tree1b24c7631ad7d9af8a8fc5ce7656bcbcdcbbe4d8 /src/display_buffer.cc
parent24234dffa3035a471126173d478d5ae215fb620e (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.cc18
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;
+}
+
}