summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-09-11 18:54:30 +0100
committerMaxime Coste <frrrwww@gmail.com>2013-09-11 18:58:23 +0100
commit916a0cb52e8637d0e6ec456363ef6412142945da (patch)
tree90f23c33c499f1fcf1f77f8f98fc48e5771572a1 /src/input_handler.cc
parent96fc340a5c2ab5fa089c2786fcc9a35ff67ccda1 (diff)
Allow :exec mode changes to remains when keys are finished
Pass keys one by one to the input handler so that BatchUI is not needed We can now use :exec to pre-fill the command line without validating the command.
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 72b68aa0..cd048482 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -978,24 +978,19 @@ bool is_valid(Key key)
return key != Key::Invalid and key.key <= 0x10FFFF;
}
-void InputHandler::handle_available_inputs()
+void InputHandler::handle_key(Key key)
{
- m_mode_trash.clear();
- while (m_context.ui().is_key_available())
+ if (is_valid(key))
{
- Key key = m_context.ui().get_key();
- if (is_valid(key))
- {
- const bool was_recording = is_recording();
+ const bool was_recording = is_recording();
- m_mode->on_key(key);
+ m_mode->on_key(key);
- // do not record the key that made us enter or leave recording mode.
- if (was_recording and is_recording())
- m_recorded_keys += key_to_str(key);
- }
- m_mode_trash.clear();
+ // do not record the key that made us enter or leave recording mode.
+ if (was_recording and is_recording())
+ m_recorded_keys += key_to_str(key);
}
+ m_mode_trash.clear();
}
void InputHandler::start_recording(char reg)