summaryrefslogtreecommitdiff
path: root/src/input_handler.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-02-27 17:23:13 +0000
committerMaxime Coste <frrrwww@gmail.com>2016-02-27 17:23:13 +0000
commit3987463e7521b70788d549ee38668716ae55d84b (patch)
treed6a22a62c13c67451e94972384069cc7b9d7f2c1 /src/input_handler.hh
parentf0edf405434f0e998f6dd8be25065860210c03c8 (diff)
Remove direct access to ui, go through client
Client can now update menu/info positions when the window move around.
Diffstat (limited to 'src/input_handler.hh')
-rw-r--r--src/input_handler.hh10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/input_handler.hh b/src/input_handler.hh
index e29114ab..8719ca15 100644
--- a/src/input_handler.hh
+++ b/src/input_handler.hh
@@ -8,8 +8,8 @@
#include "keys.hh"
#include "string.hh"
#include "utils.hh"
-#include "user_interface.hh"
#include "safe_ptr.hh"
+#include "display_buffer.hh"
namespace Kakoune
{
@@ -32,7 +32,6 @@ using PromptCallback = std::function<void (StringView, PromptEvent, Context&)>;
using KeyCallback = std::function<void (Key, Context&)>;
class InputMode;
-class DisplayLine;
enum class InsertMode : unsigned;
enum class KeymapMode : char;
@@ -62,7 +61,7 @@ public:
// abort or validation with corresponding MenuEvent value
// returns to normal mode after validation if callback does
// not change the mode itself
- void menu(ConstArrayView<DisplayLine> choices, MenuCallback callback);
+ void menu(Vector<DisplayLine> choices, MenuCallback callback);
// execute callback on next keypress and returns to normal mode
// if callback does not change the mode itself
@@ -124,6 +123,7 @@ constexpr Array<EnumDesc<AutoInfo>, 3> enum_desc(AutoInfo)
}
bool show_auto_info_ifn(StringView title, StringView info, AutoInfo mask, const Context& context);
+void hide_auto_info_ifn(const Context& context, bool hide);
template<typename Cmd>
void on_next_key_with_autoinfo(const Context& context, KeymapMode keymap_mode, Cmd cmd,
@@ -132,11 +132,11 @@ void on_next_key_with_autoinfo(const Context& context, KeymapMode keymap_mode, C
const bool hide = show_auto_info_ifn(title, info, AutoInfo::OnKey, context);
context.input_handler().on_next_key(
keymap_mode, [hide,cmd](Key key, Context& context) mutable {
- if (hide)
- context.ui().info_hide();
+ hide_auto_info_ifn(context, hide);
cmd(key, context);
});
}
+
}
#endif // input_handler_hh_INCLUDED