Slight tweak of FaceRegistry::FaceOrAlias definition

This commit is contained in:
Maxime Coste 2017-09-01 17:32:38 +07:00
parent e66a5c78ad
commit 9baebbd186
2 changed files with 24 additions and 27 deletions

View File

@ -99,28 +99,28 @@ CandidateList FaceRegistry::complete_alias_name(StringView prefix,
FaceRegistry::FaceRegistry()
: m_aliases{
{ "Default", Face{ Color::Default, Color::Default } },
{ "PrimarySelection", Face{ Color::White, Color::Blue } },
{ "SecondarySelection", Face{ Color::Black, Color::Blue } },
{ "PrimaryCursor", Face{ Color::Black, Color::White } },
{ "SecondaryCursor", Face{ Color::Black, Color::White } },
{ "LineNumbers", Face{ Color::Default, Color::Default } },
{ "LineNumberCursor", Face{ Color::Default, Color::Default, Attribute::Reverse } },
{ "LineNumbersWrapped", Face{ Color::Default, Color::Default, Attribute::Italic } },
{ "MenuForeground", Face{ Color::White, Color::Blue } },
{ "MenuBackground", Face{ Color::Blue, Color::White } },
{ "MenuInfo", Face{ Color::Cyan, Color::Default } },
{ "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 } },
{ "BufferPadding", Face{ Color::Blue, Color::Default } },
{ "Whitespace", Face{ Color::Default, Color::Default } },
{ "Default", {Face{ Color::Default, Color::Default }} },
{ "PrimarySelection", {Face{ Color::White, Color::Blue }} },
{ "SecondarySelection", {Face{ Color::Black, Color::Blue }} },
{ "PrimaryCursor", {Face{ Color::Black, Color::White }} },
{ "SecondaryCursor", {Face{ Color::Black, Color::White }} },
{ "LineNumbers", {Face{ Color::Default, Color::Default }} },
{ "LineNumberCursor", {Face{ Color::Default, Color::Default, Attribute::Reverse }} },
{ "LineNumbersWrapped", {Face{ Color::Default, Color::Default, Attribute::Italic }} },
{ "MenuForeground", {Face{ Color::White, Color::Blue }} },
{ "MenuBackground", {Face{ Color::Blue, Color::White }} },
{ "MenuInfo", {Face{ Color::Cyan, Color::Default }} },
{ "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 }} },
{ "BufferPadding", {Face{ Color::Blue, Color::Default }} },
{ "Whitespace", {Face{ Color::Default, Color::Default }} },
}
{}

View File

@ -23,12 +23,9 @@ public:
private:
struct FaceOrAlias
{
Face face;
String alias;
FaceOrAlias(Face face = Face{}) : face(face) {}
Face face = {};
String alias = {};
};
using AliasMap = HashMap<String, FaceOrAlias, MemoryDomain::Faces>;
AliasMap m_aliases;
};