From fcb8feb16fc433329e89e6385e75db7806e40d2d Mon Sep 17 00:00:00 2001 From: Dustin Swan Date: Mon, 6 Apr 2026 17:58:21 -0600 Subject: [PATCH] openLineAbove --- src/cg/textEditor.cg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cg/textEditor.cg b/src/cg/textEditor.cg index 28c7caf..f60e4b6 100644 --- a/src/cg/textEditor.cg +++ b/src/cg/textEditor.cg @@ -2,10 +2,8 @@ _ = "TODO # r to repalce -# O to open new line above # s to seek # w / b bug, can't select `textEditor` at start of line -# a to append # smart case searching "; @@ -196,6 +194,8 @@ textEditor = name \ emit = [] }; + openLineAbove = state \ openLine state.{ cursorRow = state.cursorRow - 1 }; + escape = state \ { state = state.{ mode = Normal, pending = None }, emit = [] }; undo = state \ state.undoStack @@ -445,6 +445,7 @@ textEditor = name \ | Key { key = "A" } \ appendEndLine state | Key { key = "i" } \ insertMode state | Key { key = "o" } \ openLine state + | Key { key = "O" } \ openLineAbove state | Key { key = "d", ctrl = True } \ scrollHalfDown state ctx | Key { key = "u", ctrl = True } \ scrollHalfUp state ctx | Key { key = "u" } \ undo state