diff options
| author | Maxime Coste <mawww@kakoune.org> | 2019-11-24 17:25:14 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-11-24 18:11:29 +1100 |
| commit | 6fd486c65e74d744c282a996e04beae42ca684d1 (patch) | |
| tree | c93ac65bb0d51411f9ca684406caad11acc9ce4c /src/client.cc | |
| parent | 34f48cc851e73548071ffaf799e0a52be954e11f (diff) | |
Replace tab characters with spaces in info/echo
This is tricky to fix better than that as tabs make text length
dependent on where it will get displayed and what preceedes it.
Also fix an issue with empty info title
Fixes #2237
Diffstat (limited to 'src/client.cc')
| -rw-r--r-- | src/client.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client.cc b/src/client.cc index 03f35c3f..f847d24e 100644 --- a/src/client.cc +++ b/src/client.cc @@ -425,9 +425,9 @@ void Client::info_show(StringView title, StringView content, BufferCoord anchor, { if (not content.empty() and content.back() == '\n') content = content.substr(0, content.length() - 1); - info_show({title.str(), Face{}}, + info_show(title.empty() ? DisplayLine{} : DisplayLine{title.str(), Face{}}, content | split<StringView>('\n') - | transform([](StringView s) { return DisplayLine{s.str(), Face{}}; }) + | transform([](StringView s) { return DisplayLine{replace(s, '\t', ' '), Face{}}; }) | gather<DisplayLineList>(), anchor, style); } |
