about summary refs log tree commit diff stats
path: root/edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-12-24 19:20:09 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-12-24 19:24:48 -0800
commita9aa3436fa64e77c9d3e335a50d194e79d640b58 (patch)
treecd455ca21ad171efe4c81134e8bdee83dfa16b31 /edit.lua
parent53fbb905e3383855f954f1f7ff46b1b427ef3945 (diff)
downloadtext.love-a9aa3436fa64e77c9d3e335a50d194e79d640b58.tar.gz
bugfix
Scenario: make some edits, select some text, make some more edits. Press
ctrl-z.

Before this commit, undo would stop at the point of selection and
previous edits would become unreachable.

After this commit, both ctrl-z and ctrl-y seem able to span the point of
selection.
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/edit.lua b/edit.lua
index 4bee708..727f6e0 100644
--- a/edit.lua
+++ b/edit.lua
@@ -304,7 +304,7 @@ function edit.keychord_press(State, chord, key)
       -- printable character created using shift key => delete selection
       -- (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 not App.is_cursor_movement(chord) then
+      chord ~= 'C-a' and chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and chord ~= 'delete' and chord ~= 'C-z' and not App.is_cursor_movement(chord) then
     Text.delete_selection(State, State.left, State.right)
   end
   if State.search_term then