diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2024-09-01 01:17:22 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2024-09-01 01:17:22 -0700 |
commit | af0d177d57978755f405404d1ebab21479e42ee9 (patch) | |
tree | b9831e7c11dfac96c1ce62e898eaa7092021549d /source_edit.lua | |
parent | caa736267b23b4e330d5f556fa96887eb953802a (diff) | |
parent | 52f876302f7e6da1f8f418d9dc85f0698c494e15 (diff) | |
download | text.love-af0d177d57978755f405404d1ebab21479e42ee9.tar.gz |
Merge lines.love
Diffstat (limited to 'source_edit.lua')
-rw-r--r-- | source_edit.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source_edit.lua b/source_edit.lua index fead6c5..2dca05d 100644 --- a/source_edit.lua +++ b/source_edit.lua @@ -190,6 +190,7 @@ function edit.draw(State, hide_cursor, show_line_numbers) State.cursor1.line = State.cursor1.line+1 end record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)}) + Drawing.before = nil schedule_save(State) end, }) @@ -391,7 +392,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 @@ -469,7 +470,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 |