diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-07-12 16:43:23 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-07-12 16:51:18 -0700 |
commit | 188bbc73cc3c0baddcf48f2501b18248b7ed3fc1 (patch) | |
tree | 60fd7e7a527b340bf7a9b1881498ec5825ca13b4 /edit.lua | |
parent | 800a5c064aeb6978928854e74a289702355f00f2 (diff) | |
download | text.love-188bbc73cc3c0baddcf48f2501b18248b7ed3fc1.tar.gz |
add state arg to a few functions
- Text.draw_highlight - Text.clip_selection - Text.selection - Text.cut_selection - Text.delete_selection - Text.delete_selection_without_undo - Text.mouse_pos - Text.to_pos
Diffstat (limited to 'edit.lua')
-rw-r--r-- | edit.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/edit.lua b/edit.lua index f4d2c6c..566efb7 100644 --- a/edit.lua +++ b/edit.lua @@ -299,7 +299,7 @@ function edit.keychord_pressed(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-c' and chord ~= 'C-x' and chord ~= 'backspace' and backspace ~= 'delete' and not App.is_cursor_movement(chord) then - Text.delete_selection(State.margin_left, App.screen.width-State.margin_right) + Text.delete_selection(State, State.margin_left, App.screen.width-State.margin_right) end if State.search_term then if chord == 'escape' then @@ -365,13 +365,13 @@ function edit.keychord_pressed(State, chord, key) -- clipboard elseif chord == 'C-c' then for _,line in ipairs(State.lines) do line.y = nil end -- just in case we scroll - local s = Text.selection() + local s = Text.selection(State) if s then App.setClipboardText(s) end elseif chord == 'C-x' then for _,line in ipairs(State.lines) do line.y = nil end -- just in case we scroll - local s = Text.cut_selection(State.margin_left, App.screen.width-State.margin_right) + local s = Text.cut_selection(State, State.margin_left, App.screen.width-State.margin_right) if s then App.setClipboardText(s) end |