drop an arg from a function
This commit is contained in:
parent
cff1e58cf6
commit
048b6d9d3a
4
main.lua
4
main.lua
|
@ -338,7 +338,7 @@ function App.mousepressed(x,y, mouse_button)
|
|||
|
||||
for line_index,line in ipairs(Lines) do
|
||||
if line.mode == 'text' then
|
||||
if Text.in_line(line_index,line, x,y) then
|
||||
if Text.in_line(line, x,y) then
|
||||
-- delicate dance between cursor, selection and old cursor/selection
|
||||
-- scenarios:
|
||||
-- regular press+release: sets cursor, clears selection
|
||||
|
@ -382,7 +382,7 @@ function App.mousereleased(x,y, button)
|
|||
else
|
||||
for line_index,line in ipairs(Lines) do
|
||||
if line.mode == 'text' then
|
||||
if Text.in_line(line_index,line, x,y) then
|
||||
if Text.in_line(line, x,y) then
|
||||
--? print('reset selection')
|
||||
Cursor1 = {line=line_index, pos=Text.to_pos_on_line(line, x, y)}
|
||||
--? print('cursor', Cursor1.line, Cursor1.pos)
|
||||
|
|
|
@ -95,7 +95,7 @@ end
|
|||
function Text.to_pos(x,y)
|
||||
for line_index,line in ipairs(Lines) do
|
||||
if line.mode == 'text' then
|
||||
if Text.in_line(line_index,line, x,y) then
|
||||
if Text.in_line(line, x,y) then
|
||||
return line_index, Text.to_pos_on_line(line, x,y)
|
||||
end
|
||||
end
|
||||
|
|
2
text.lua
2
text.lua
|
@ -663,7 +663,7 @@ function Text.snap_cursor_to_bottom_of_screen()
|
|||
Text.redraw_all() -- if we're scrolling, reclaim all fragments to avoid memory leaks
|
||||
end
|
||||
|
||||
function Text.in_line(line_index,line, x,y)
|
||||
function Text.in_line(line, x,y)
|
||||
if line.starty == nil then return false end -- outside current page
|
||||
if x < Margin_left then return false end
|
||||
if y < line.starty then return false end
|
||||
|
|
Loading…
Reference in New Issue