diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-09-19 12:19:17 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-09-19 12:19:17 +0100 |
| commit | 6bc5f8c3a3f0ef2e0a4bfb51beb756608554597e (patch) | |
| tree | 5c6333282cd0c3bf2e71b0528567180a0b974720 /src/commands.cc | |
| parent | db8c12fd2a9ccb3d44445e4539bc10a0f4e5c7e6 (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.cc | 3 |
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()); |
