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: case Key::Backspace:
m_inserter.erase(); m_inserter.erase();
break; 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: default:
m_inserter.insert(String() + key.key); m_inserter.insert(String() + key.key);
} }
@ -347,12 +359,6 @@ public:
case 'i': case 'i':
m_inserter.insert(String() + '\t'); m_inserter.insert(String() + '\t');
break; break;
case 'd':
m_inserter.move_cursors({0, -1});
break;
case 'e':
m_inserter.move_cursors({0, 1});
break;
} }
break; break;
} }