'o' and 'a' from Vim
This commit is contained in:
18
src/main.cpp
18
src/main.cpp
@@ -226,6 +226,24 @@ int main(int argc, char** argv) {
|
||||
lines = undoHistory[undos].lines;
|
||||
pos = undoHistory[undos].pos;
|
||||
break;
|
||||
case 'a':
|
||||
currMode = mode::INSERT;
|
||||
if (!(pos.x + 1 > lines[pos.y].size())) {
|
||||
pos.x ++;
|
||||
}
|
||||
break;
|
||||
case 'o':
|
||||
currMode = mode::INSERT;
|
||||
{
|
||||
size_t line_idx = pos.y - 1;
|
||||
if (line_idx < lines.size()) {
|
||||
lines.insert(lines.begin() + line_idx + 1, "");
|
||||
pos.y++;
|
||||
pos.x = 0;
|
||||
if (!fileChanged) fileChanged = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'h':
|
||||
case KEY_LEFT:
|
||||
if (pos.x > 0) {
|
||||
|
||||
Reference in New Issue
Block a user