summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-11-07 20:36:45 +0100
committerMaxime Coste <frrrwww@gmail.com>2012-11-29 19:03:17 +0100
commit7dc634444db3fc5f2707bd15cfa5091be8f75938 (patch)
treee21fbdc5c31d0742612eed583e9658b9b80330d4 /src/input_handler.cc
parenta6f0d53dbf82c622e7e24247380b85948b0f976f (diff)
Fix InputMode::Prompt blocking behaviour when inserting register
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 44327df9..19d2ce17 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -243,7 +243,14 @@ public:
{
std::vector<String>& history = ms_history[m_prompt];
const String& line = m_line_editor.line();
- if (key == Key{Key::Modifiers::Control, 'm'}) // enter
+
+ if (m_insert_reg)
+ {
+ String reg = RegisterManager::instance()[key.key].values(context)[0];
+ m_line_editor.insert(reg);
+ m_insert_reg = false;
+ }
+ else if (key == Key{Key::Modifiers::Control, 'm'}) // enter
{
std::vector<String>::iterator it;
while ((it = find(history, line)) != history.end())
@@ -267,9 +274,7 @@ public:
}
else if (key == Key{Key::Modifiers::Control, 'r'})
{
- Key k = context.ui().get_key();
- String reg = RegisterManager::instance()[k.key].values(context)[0];
- m_line_editor.insert(reg);
+ m_insert_reg = true;
}
else if (key == Key::Up or
key == Key{Key::Modifiers::Control, 'p'})
@@ -362,6 +367,7 @@ private:
int m_current_completion = -1;
String m_prefix;
LineEditor m_line_editor;
+ bool m_insert_reg = false;
static std::unordered_map<String, std::vector<String>> ms_history;
std::vector<String>::iterator m_history_it;