Correctly handle arrow keys in insert mode

This commit is contained in:
Maxime Coste 2012-09-11 19:09:14 +02:00
parent e39086cd5f
commit 9dfccddca8

View File

@ -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;
}