From b51bb8b8d20dde457be3235d90ff5812101e943f Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Wed, 15 Oct 2025 18:05:44 +1100 Subject: [PATCH] 'o' and 'a' from Vim --- src/main.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 3ccd849..0ed7e0f 100644 --- a/src/main.cpp +++ b/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) {