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('\n') - | transform([](StringView s) { return DisplayLine{s.str(), Face{}}; }) + | transform([](StringView s) { return DisplayLine{replace(s, '\t', ' '), Face{}}; }) | gather(), anchor, style); } diff --git a/src/commands.cc b/src/commands.cc index 728b4403..8fe38134 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1277,7 +1277,7 @@ const CommandDesc echo_cmd = { else if (parser.get_switch("markup")) context.print_status(parse_display_line(message, context.faces())); else - context.print_status({ std::move(message), context.faces()["StatusLine"] }); + context.print_status({replace(message, '\t', ' '), context.faces()["StatusLine"]}); } }; diff --git a/src/display_buffer.cc b/src/display_buffer.cc index 12a234e2..e7e2da54 100644 --- a/src/display_buffer.cc +++ b/src/display_buffer.cc @@ -286,7 +286,7 @@ DisplayLine parse_display_line(StringView line, const FaceRegistry& faces, const pos = closing + 1; } } - if (c == '\n') // line breaks are forbidden, replace with space + if (c == '\n' or c == '\t') // line breaks and tabs are forbidden, replace with space { content += StringView{pos, it+1}; content.back() = ' ';