Replace highlight colors with prefixes and suffixes

This commit is contained in:
Andrzej Rybczak
2017-03-28 11:31:09 +02:00
parent 8134e6e23b
commit 19d32648ed
32 changed files with 364 additions and 155 deletions

View File

@@ -497,7 +497,7 @@ void ShowTag(BufferT &buf, const std::string &tag)
if (tag.empty())
buf << Config.empty_tags_color
<< Config.empty_tag
<< NC::FormattedColor::End(Config.empty_tags_color);
<< NC::FormattedColor::End<>(Config.empty_tags_color);
else
buf << tag;
}
@@ -509,6 +509,20 @@ inline NC::Buffer ShowTag(const std::string &tag)
return result;
}
template <typename T>
void setHighlightFixes(NC::Menu<T> &m)
{
m.setHighlightPrefix(Config.current_item_prefix);
m.setHighlightSuffix(Config.current_item_suffix);
}
template <typename T>
void setHighlightInactiveColumnFixes(NC::Menu<T> &m)
{
m.setHighlightPrefix(Config.current_item_inactive_column_prefix);
m.setHighlightSuffix(Config.current_item_inactive_column_suffix);
}
inline const char *withErrors(bool success)
{
return success ? "" : " " "(with errors)";