Merge luaML.love

This commit is contained in:
Kartik K. Agaram 2023-12-03 11:50:53 -08:00
commit c9b114b72f
1 changed files with 0 additions and 5 deletions

View File

@ -245,7 +245,6 @@ function edit.text_input(State, t, readonly)
State.search_term = State.search_term..t State.search_term = State.search_term..t
Text.search_next(State) Text.search_next(State)
elseif not readonly then elseif not readonly then
for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
Text.text_input(State, t) Text.text_input(State, t)
end end
end end
@ -302,7 +301,6 @@ function edit.keychord_press(State, chord, key, readonly)
Text.redraw_all(State) Text.redraw_all(State)
-- undo -- undo
elseif not readonly and chord == 'C-z' then elseif not readonly and chord == 'C-z' then
for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
local event = undo_event(State) local event = undo_event(State)
if event then if event then
local src = event.before local src = event.before
@ -315,7 +313,6 @@ function edit.keychord_press(State, chord, key, readonly)
Text.redraw_all(State) Text.redraw_all(State)
end end
elseif not readonly and chord == 'C-y' then elseif not readonly and chord == 'C-y' then
for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
local event = redo_event(State) local event = redo_event(State)
if event then if event then
local src = event.after local src = event.after
@ -336,13 +333,11 @@ function edit.keychord_press(State, chord, key, readonly)
App.set_clipboard(s) App.set_clipboard(s)
end end
elseif not readonly and chord == 'C-x' then elseif not readonly and chord == 'C-x' then
for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
local s = Text.cut_selection(State, State.left, State.right) local s = Text.cut_selection(State, State.left, State.right)
if s then if s then
App.set_clipboard(s) App.set_clipboard(s)
end end
elseif not readonly and chord == 'C-v' then elseif not readonly and chord == 'C-v' then
for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
-- We don't have a good sense of when to scroll, so we'll be conservative -- We don't have a good sense of when to scroll, so we'll be conservative
-- and sometimes scroll when we didn't quite need to. -- and sometimes scroll when we didn't quite need to.
local before_line = State.cursor1.line local before_line = State.cursor1.line