about summary refs log tree commit diff stats
path: root/edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-17 09:05:50 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-17 09:14:10 -0700
commit48b7de4fde195abc0e41deec709d2ba1f52f6fbb (patch)
tree32414e8df351837ea51d9ae7a3d282cfa13ce07d /edit.lua
parentc0ea3696075fb6e8369bb67449153e834d684101 (diff)
downloadtext.love-48b7de4fde195abc0e41deec709d2ba1f52f6fbb.tar.gz
switch to line index in a function
  - Text.in_line
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/edit.lua b/edit.lua
index f1c032f..2de3cb2 100644
--- a/edit.lua
+++ b/edit.lua
@@ -200,7 +200,7 @@ function edit.mouse_pressed(State, x,y, mouse_button)
 
   for line_index,line in ipairs(State.lines) do
     if line.mode == 'text' then
-      if Text.in_line(State, line, x,y) then
+      if Text.in_line(State, line_index, x,y) then
         -- delicate dance between cursor, selection and old cursor/selection
         -- scenarios:
         --  regular press+release: sets cursor, clears selection
@@ -245,7 +245,7 @@ function edit.mouse_released(State, x,y, mouse_button)
   else
     for line_index,line in ipairs(State.lines) do
       if line.mode == 'text' then
-        if Text.in_line(State, line, x,y) then
+        if Text.in_line(State, line_index, x,y) then
 --?           print('reset selection')
           State.cursor1 = {
               line=line_index,