Add StatusLine{Mode,Info,Value} built in faces

Fixes #491
This commit is contained in:
Maxime Coste 2015-11-24 13:53:15 +00:00
parent ad5c8db7a8
commit e45b0c3ffc
2 changed files with 13 additions and 10 deletions

View File

@ -110,6 +110,9 @@ FaceRegistry::FaceRegistry()
{ "Information", Face{ Color::Black, Color::Yellow } },
{ "Error", Face{ Color::Black, Color::Red } },
{ "StatusLine", Face{ Color::Cyan, Color::Default } },
{ "StatusLineMode", Face{ Color::Yellow, Color::Default } },
{ "StatusLineInfo", Face{ Color::Blue, Color::Default } },
{ "StatusLineValue", Face{ Color::Green, Color::Default } },
{ "StatusCursor", Face{ Color::Black, Color::Cyan } },
{ "Prompt", Face{ Color::Yellow, Color::Default } },
{ "MatchingChar", Face{ Color::Default, Color::Default, Attribute::Bold } },

View File

@ -270,16 +270,16 @@ public:
DisplayLine mode_line() const override
{
AtomList atoms = { { to_string(context().selections().size()) + " sel", Face(Color::Blue) } };
AtomList atoms = { { to_string(context().selections().size()) + " sel", get_face("StatusLineInfo") } };
if (m_params.count != 0)
{
atoms.push_back({ "; param=", Face(Color::Yellow) });
atoms.push_back({ to_string(m_params.count), Face(Color::Green) });
atoms.push_back({ " param=", get_face("StatusLineInfo") });
atoms.push_back({ to_string(m_params.count), get_face("StatusLineValue") });
}
if (m_params.reg)
{
atoms.push_back({ "; reg=", Face(Color::Yellow) });
atoms.push_back({ StringView(m_params.reg).str(), Face(Color::Green) });
atoms.push_back({ " reg=", get_face("StatusLineInfo") });
atoms.push_back({ StringView(m_params.reg).str(), get_face("StatusLineValue") });
}
return atoms;
}
@ -586,7 +586,7 @@ public:
DisplayLine mode_line() const override
{
return { "menu", Face(Color::Yellow) };
return { "menu", get_face("StatusLineMode") };
}
KeymapMode keymap_mode() const override { return KeymapMode::Menu; }
@ -854,7 +854,7 @@ public:
DisplayLine mode_line() const override
{
return { "prompt", Face(Color::Yellow) };
return { "prompt", get_face("StatusLineMode") };
}
KeymapMode keymap_mode() const override { return KeymapMode::Prompt; }
@ -944,7 +944,7 @@ public:
DisplayLine mode_line() const override
{
return { "enter key", Face(Color::Yellow) };
return { "enter key", get_face("StatusLineMode") };
}
KeymapMode keymap_mode() const override { return m_keymap_mode; }
@ -1157,8 +1157,8 @@ public:
DisplayLine mode_line() const override
{
auto num_sel = context().selections().size();
return {AtomList{ { "insert ", Face(Color::Green) },
{ format( "{} sel", num_sel), Face(Color::Blue) } }};
return {AtomList{ { "insert ", get_face("StatusLineMode") },
{ format( "{} sel", num_sel), get_face("StatusLineInfo") } }};
}
KeymapMode keymap_mode() const override { return KeymapMode::Insert; }