summaryrefslogtreecommitdiff
path: root/src/client_manager.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-04-04 18:50:00 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-04-04 18:50:00 +0200
commitf540566b1b4565f9306101c67fa51776ff7dc0dc (patch)
tree32a3ea1e476cfb8b8572a6460645b5c7f937681a /src/client_manager.cc
parent6ffdfd77353748f855b1528cdc6ca44b7154bfe3 (diff)
UserInterface: status line messages are now DisplayLines
This add color support for the status line
Diffstat (limited to 'src/client_manager.cc')
-rw-r--r--src/client_manager.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client_manager.cc b/src/client_manager.cc
index a7919cf1..fc95c118 100644
--- a/src/client_manager.cc
+++ b/src/client_manager.cc
@@ -4,6 +4,7 @@
#include "buffer_manager.hh"
#include "command_manager.hh"
#include "file.hh"
+#include "color_registry.hh"
namespace Kakoune
{
@@ -64,7 +65,7 @@ void ClientManager::create_client(std::unique_ptr<UserInterface>&& ui,
}
catch (Kakoune::runtime_error& error)
{
- context->print_status(error.description());
+ context->print_status({ error.description(), get_color("Error") });
context->hooks().run_hook("RuntimeError", error.description(), *context);
}
catch (Kakoune::client_removed&)
@@ -81,7 +82,7 @@ void ClientManager::create_client(std::unique_ptr<UserInterface>&& ui,
}
catch (Kakoune::runtime_error& error)
{
- context->print_status(error.description());
+ context->print_status({ error.description(), get_color("Error") });
context->hooks().run_hook("RuntimeError", error.description(), *context);
}
catch (Kakoune::client_removed&)
@@ -191,7 +192,7 @@ Context& ClientManager::get_client_context(const String& name)
throw runtime_error("no client named: " + name);
}
-static String generate_status_line(const Context& context)
+static DisplayLine generate_status_line(const Context& context)
{
BufferCoord cursor = context.editor().main_selection().last().coord();
std::ostringstream oss;
@@ -207,7 +208,7 @@ static String generate_status_line(const Context& context)
oss << " [" << context.editor().selections().size() << " sel]";
if (context.editor().is_editing())
oss << " [insert]";
- return oss.str();
+ return { oss.str(), get_color("StatusLine") };
}
void ClientManager::redraw_clients() const