From 00c64ed6e49fd679bb2d08dd076f585842bbf423 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 8 Jul 2022 15:37:09 -0700 Subject: add args to some functions - Text.in_line --- main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 37d5d01..08cad48 100644 --- a/main.lua +++ b/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, x,y) then + if Text.in_line(line, x,y, Margin_left, App.screen.width-Margin_right) 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, x,y) then + if Text.in_line(line, x,y, Margin_left, App.screen.width-Margin_right) then --? print('reset selection') Cursor1 = {line=line_index, pos=Text.to_pos_on_line(line, x, y)} --? print('cursor', Cursor1.line, Cursor1.pos) -- cgit 1.4.1-2-gfad0