about summary refs log tree commit diff stats
path: root/edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2024-08-31 18:59:23 -0700
committerKartik K. Agaram <vc@akkartik.com>2024-08-31 18:59:23 -0700
commitf98cdd14fd876f57a8dc753316fc27994242828f (patch)
tree5cf7dd0e0d7c7c87f2893eabe493d4e63530c1c8 /edit.lua
parent5c8e3e96c8b852394cd2b0956d6e9bb0b6cc543d (diff)
downloadview.love-f98cdd14fd876f57a8dc753316fc27994242828f.tar.gz
explicitly state when operations manage undo
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/edit.lua b/edit.lua
index 9a223bf..f65486c 100644
--- a/edit.lua
+++ b/edit.lua
@@ -386,7 +386,7 @@ function edit.keychord_press(State, chord, key)
       -- (we're not creating any ctrl-shift- or alt-shift- combinations using regular/printable keys)
       (not App.shift_down() or utf8.len(key) == 1) and
       chord ~= 'C-a' and chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and chord ~= 'delete' and chord ~= 'C-z' and chord ~= 'C-y' and not App.is_cursor_movement(key) then
-    Text.delete_selection(State, State.left, State.right)
+    Text.delete_selection_and_record_undo_event(State)
   end
   if State.search_term then
     if chord == 'escape' then
@@ -467,7 +467,7 @@ function edit.keychord_press(State, chord, key)
       App.set_clipboard(s)
     end
   elseif chord == 'C-x' then
-    local s = Text.cut_selection(State, State.left, State.right)
+    local s = Text.cut_selection_and_record_undo_event(State)
     if s then
       App.set_clipboard(s)
     end