From 9dfccddca808f07c4a9219b50b64e5c3558f38ff Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 11 Sep 2012 19:09:14 +0200 Subject: [PATCH] Correctly handle arrow keys in insert mode --- src/client.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/client.cc b/src/client.cc index d62842f7..cc31031f 100644 --- a/src/client.cc +++ b/src/client.cc @@ -331,6 +331,18 @@ public: case Key::Backspace: m_inserter.erase(); break; + case Key::Left: + m_inserter.move_cursors({0, -1}); + break; + case Key::Right: + m_inserter.move_cursors({0, 1}); + break; + case Key::Up: + m_inserter.move_cursors({-1, 0}); + break; + case Key::Down: + m_inserter.move_cursors({ 1, 0}); + break; default: m_inserter.insert(String() + key.key); } @@ -347,12 +359,6 @@ public: case 'i': m_inserter.insert(String() + '\t'); break; - case 'd': - m_inserter.move_cursors({0, -1}); - break; - case 'e': - m_inserter.move_cursors({0, 1}); - break; } break; }