summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-11-18 23:43:51 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-11-18 23:47:28 +0000
commit9656f088e77ea05501539ce63b7420f13b287139 (patch)
treedeefe0d248f770347bccc3a4b105c33331ec7f3d /src/input_handler.cc
parent5c37f0dd5ee08c1975aedf46c9f0827108589da1 (diff)
Change autoinfo option to be a flags option, document flags options
Support the value1|value2|value3 syntax for flag options.
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 80178984..353ced8a 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -251,7 +251,8 @@ public:
{ return lhs.key < rhs; });
if (it != keymap.end() and it->key == key)
{
- if (context().options()["autoinfo"].get<int>() >= 2 and context().has_ui())
+ auto autoinfo = context().options()["autoinfo"].get<AutoInfo>();
+ if (autoinfo & AutoInfo::Normal and context().has_ui())
context().ui().info_show(key_to_str(key), it->docstring, CharCoord{},
get_face("Information"), InfoStyle::Prompt);
@@ -1413,13 +1414,15 @@ DisplayLine InputHandler::mode_line() const
return current_mode().mode_line();
}
-
-bool show_auto_info_ifn(StringView title, StringView info, const Context& context)
+bool show_auto_info_ifn(StringView title, StringView info, AutoInfo mask, const Context& context)
{
- if (context.options()["autoinfo"].get<int>() < 1 or not context.has_ui())
+ if ((context.options()["autoinfo"].get<AutoInfo>() & mask) or
+ not context.has_ui())
return false;
+
Face face = get_face("Information");
context.ui().info_show(title, info, CharCoord{}, face, InfoStyle::Prompt);
return true;
}
+
}