summaryrefslogtreecommitdiff
path: root/src/client.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-11-24 11:39:33 +1100
committerMaxime Coste <mawww@kakoune.org>2019-11-24 18:11:29 +1100
commit34f48cc851e73548071ffaf799e0a52be954e11f (patch)
tree42adcdfcfad9ff535b0cc3737260253e18454ea0 /src/client.cc
parent19e1be8e0d1946bbff02412ec703be33c7f4fede (diff)
Rework ncurses info display, crop content when overlflowing
Optmize the code to avoid allocating like crazy, unify various info style rendering, crop content and display markers that there is more text remaining. Fixes #2257
Diffstat (limited to 'src/client.cc')
-rw-r--r--src/client.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client.cc b/src/client.cc
index c4312aca..03f35c3f 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -423,6 +423,8 @@ void Client::info_show(DisplayLine title, DisplayLineList content, BufferCoord a
void Client::info_show(StringView title, StringView content, BufferCoord anchor, InfoStyle style)
{
+ if (not content.empty() and content.back() == '\n')
+ content = content.substr(0, content.length() - 1);
info_show({title.str(), Face{}},
content | split<StringView>('\n')
| transform([](StringView s) { return DisplayLine{s.str(), Face{}}; })