summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-11-28 13:15:12 +0000
committerMaxime Coste <frrrwww@gmail.com>2016-11-28 13:15:12 +0000
commit54d540021cd50dc78e58a127e4770dc7b26e161f (patch)
tree62ab8ee004b6e68e30ac9e1de872b6fc0693bb38 /src/input_handler.cc
parent34be6c42e79bbc41404d0cb75923967183a44563 (diff)
Add support for mouse in insert mode
Fixes #940
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 7a4ecabd..32bd322d 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -208,7 +208,7 @@ public:
if (m_mouse_handler.handle_key(key, context()))
m_idle_timer.set_next_date(Clock::now() + get_idle_timeout(context()));
- if (cp and isdigit(*cp))
+ else if (cp and isdigit(*cp))
{
int new_val = m_params.count * 10 + *cp - '0';
if (new_val < 0)
@@ -1021,7 +1021,9 @@ public:
bool update_completions = true;
bool moved = false;
- if (key == Key::Escape or key == ctrl('c'))
+ if (m_mouse_handler.handle_key(key, context()))
+ m_idle_timer.set_next_date(Clock::now() + get_idle_timeout(context()));
+ else if (key == Key::Escape or key == ctrl('c'))
{
if (m_in_end)
throw runtime_error("Asked to exit insert mode while running InsertEnd hook");
@@ -1285,6 +1287,7 @@ private:
bool m_autoshowcompl;
Timer m_idle_timer;
bool m_in_end = false;
+ MouseHandler m_mouse_handler;
};
}