diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2024-07-16 21:32:13 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2024-07-16 21:32:13 -0700 |
commit | c7c54a00b69eeffe1b21cc0db47a764089bdf8bc (patch) | |
tree | 4e1bac29967586a00b4c58737ec8b26c65d21f8c /source_edit.lua | |
parent | 57deb762f033538a2d00fa9a2a8ae6e11729329d (diff) | |
download | text.love-c7c54a00b69eeffe1b21cc0db47a764089bdf8bc.tar.gz |
consistently schedule_save after all mutations
Diffstat (limited to 'source_edit.lua')
-rw-r--r-- | source_edit.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source_edit.lua b/source_edit.lua index fd8e321..fead6c5 100644 --- a/source_edit.lua +++ b/source_edit.lua @@ -189,8 +189,8 @@ function edit.draw(State, hide_cursor, show_line_numbers) if State.cursor1.line >= line_index then State.cursor1.line = State.cursor1.line+1 end - schedule_save(State) record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)}) + schedule_save(State) end, }) end @@ -299,11 +299,11 @@ function edit.mouse_release(State, x,y, mouse_button) State.mouse_down = nil if State.lines.current_drawing then Drawing.mouse_release(State, x,y, mouse_button) - schedule_save(State) if Drawing.before then record_undo_event(State, {before=Drawing.before, after=snapshot(State, State.lines.current_drawing_index)}) Drawing.before = nil end + schedule_save(State) else --? print_and_log('edit.mouse_release: no current drawing') if y < State.top then @@ -491,8 +491,8 @@ function edit.keychord_press(State, chord, key) if Text.cursor_out_of_screen(State) then Text.snap_cursor_to_bottom_of_screen(State, State.left, State.right) end - schedule_save(State) record_undo_event(State, {before=before, after=snapshot(State, before_line, State.cursor1.line)}) + schedule_save(State) -- dispatch to drawing or text elseif App.mouse_down(1) or chord:sub(1,2) == 'C-' then local drawing_index, drawing = Drawing.current_drawing(State) |