summaryrefslogtreecommitdiff
path: root/src/commands.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-09-19 12:19:17 +0100
committerMaxime Coste <frrrwww@gmail.com>2015-09-19 12:19:17 +0100
commit6bc5f8c3a3f0ef2e0a4bfb51beb756608554597e (patch)
tree5c6333282cd0c3bf2e71b0528567180a0b974720 /src/commands.cc
parentdb8c12fd2a9ccb3d44445e4539bc10a0f4e5c7e6 (diff)
Add simple markup support to generate display lines from strings
The syntax is simply {face} to enable the given face, use \{ to escape a {, and \\ to escape a \.
Diffstat (limited to 'src/commands.cc')
-rw-r--r--src/commands.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/commands.cc b/src/commands.cc
index b93114a8..0c35cb26 100644
--- a/src/commands.cc
+++ b/src/commands.cc
@@ -891,6 +891,7 @@ const CommandDesc echo_cmd = {
"echo <params>...: display given parameters in the status line",
ParameterDesc{
{ { "color", { true, "set message color" } },
+ { "markup", { false, "parse markup" } },
{ "debug", { false, "write to debug buffer instead of status line" } } },
ParameterDesc::Flags::SwitchesOnlyAtStart
},
@@ -902,6 +903,8 @@ const CommandDesc echo_cmd = {
String message = join(parser, ' ', false);
if (parser.get_switch("debug"))
write_to_debug_buffer(message);
+ else if (parser.get_switch("markup"))
+ context.print_status(parse_display_line(message, get_face("StatusLine")));
else
{
auto face = get_face(parser.get_switch("color").value_or("StatusLine").str());