Merge lines.love
This commit is contained in:
commit
df2cfb820d
5
edit.lua
5
edit.lua
|
@ -259,7 +259,6 @@ function edit.text_input(State, t)
|
||||||
State.search_term = State.search_term..t
|
State.search_term = State.search_term..t
|
||||||
Text.search_next(State)
|
Text.search_next(State)
|
||||||
else
|
else
|
||||||
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
|
||||||
schedule_save(State)
|
schedule_save(State)
|
||||||
|
@ -315,7 +314,6 @@ function edit.keychord_press(State, chord, key)
|
||||||
Text.redraw_all(State)
|
Text.redraw_all(State)
|
||||||
-- undo
|
-- undo
|
||||||
elseif chord == 'C-z' then
|
elseif 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
|
||||||
|
@ -329,7 +327,6 @@ function edit.keychord_press(State, chord, key)
|
||||||
schedule_save(State)
|
schedule_save(State)
|
||||||
end
|
end
|
||||||
elseif chord == 'C-y' then
|
elseif 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
|
||||||
|
@ -351,14 +348,12 @@ function edit.keychord_press(State, chord, key)
|
||||||
App.set_clipboard(s)
|
App.set_clipboard(s)
|
||||||
end
|
end
|
||||||
elseif chord == 'C-x' then
|
elseif 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
|
||||||
schedule_save(State)
|
schedule_save(State)
|
||||||
elseif chord == 'C-v' then
|
elseif 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
|
||||||
|
|
|
@ -384,7 +384,6 @@ function edit.text_input(State, t)
|
||||||
else
|
else
|
||||||
local drawing_index, drawing = Drawing.current_drawing(State)
|
local drawing_index, drawing = Drawing.current_drawing(State)
|
||||||
if drawing_index == nil then
|
if drawing_index == nil 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
|
||||||
|
@ -442,7 +441,6 @@ function edit.keychord_press(State, chord, key)
|
||||||
Text.redraw_all(State)
|
Text.redraw_all(State)
|
||||||
-- undo
|
-- undo
|
||||||
elseif chord == 'C-z' then
|
elseif 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
|
||||||
|
@ -458,7 +456,6 @@ function edit.keychord_press(State, chord, key)
|
||||||
schedule_save(State)
|
schedule_save(State)
|
||||||
end
|
end
|
||||||
elseif chord == 'C-y' then
|
elseif 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
|
||||||
|
@ -482,14 +479,12 @@ function edit.keychord_press(State, chord, key)
|
||||||
App.set_clipboard(s)
|
App.set_clipboard(s)
|
||||||
end
|
end
|
||||||
elseif chord == 'C-x' then
|
elseif 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
|
||||||
schedule_save(State)
|
schedule_save(State)
|
||||||
elseif chord == 'C-v' then
|
elseif 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
|
||||||
|
|
Loading…
Reference in New Issue