From 3987463e7521b70788d549ee38668716ae55d84b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 27 Feb 2016 17:23:13 +0000 Subject: Remove direct access to ui, go through client Client can now update menu/info positions when the window move around. --- src/input_handler.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/input_handler.hh') 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; using KeyCallback = std::function; 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 choices, MenuCallback callback); + void menu(Vector 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, 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 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 -- cgit v1.2.3