summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-04-04 11:00:25 +1000
committerMaxime Coste <mawww@kakoune.org>2018-04-04 11:00:25 +1000
commit6ee60ff9d7a4b6d4ae872dac8f7c72e15f7dc616 (patch)
treeb1c00ad43a229099fb4bd38409b983d9cdc35fa2 /src/input_handler.cc
parente6a9e148724f02e7bd6ba589e1a6ed15c21829f3 (diff)
Prompt: add <a-!> to expand the typed expansions in current line
Fixes #1952
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 3b80d4ee..f95fff6c 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -4,6 +4,7 @@
#include "buffer_manager.hh"
#include "buffer_utils.hh"
+#include "command_manager.hh"
#include "client.hh"
#include "event_manager.hh"
#include "face_registry.hh"
@@ -875,6 +876,18 @@ public:
if (context().has_client())
context().client().menu_hide();
}
+ else if (key == alt('!'))
+ {
+ try
+ {
+ m_line_editor.reset(expand(m_line_editor.line(), context()), m_empty_text);
+ }
+ catch (std::runtime_error& error)
+ {
+ context().print_status({error.what(), get_face("Error")});
+ return;
+ }
+ }
else
{
m_line_editor.handle_key(key);