about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-20 13:22:55 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-20 13:30:54 -0700
commit5a0b6c6a5804c22a7fe62300ff10b8bf890f083a (patch)
tree0ac898b3533157e7eb1830fcf8a8231f382235d2
parent0d1e6aacd954146209b944f2bebc8033bcb13c23 (diff)
downloadview.love-5a0b6c6a5804c22a7fe62300ff10b8bf890f083a.tar.gz
better fix for commit 3ffc2ed8f
I'm giving up finding a more generalized solution. The issue is that we
need the correct selection state right up to the point where we modify
Lines, in order to capture precise undo state.

Hopefully there aren't any other keychords that should clear the
selection.
-rw-r--r--text.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/text.lua b/text.lua
index 8753a7b..5dbecc9 100644
--- a/text.lua
+++ b/text.lua
@@ -172,6 +172,7 @@ function Text.keychord_pressed(chord)
     local before_line = Cursor1.line
     local before = snapshot(before_line)
     Text.insert_return()
+    Selection1 = {}
     if (Cursor_y + Line_height) > App.screen.height then
       Text.snap_cursor_to_bottom_of_screen()
     end