about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-09 15:22:21 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-09 15:22:21 -0700
commit8f823bf43052be3b9e742534e1c33d8fa9676d13 (patch)
tree3fc0835ebcb2a61267f22d06a03336e8a82481d5
parent173d3a3de0a99769e0378436c4375f8bd39aef5c (diff)
downloadtext.love-8f823bf43052be3b9e742534e1c33d8fa9676d13.tar.gz
.
-rw-r--r--main.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/main.lua b/main.lua
index 9b6fb35..b318fb8 100644
--- a/main.lua
+++ b/main.lua
@@ -274,8 +274,7 @@ function App.mousepressed(x,y, mouse_button)
         if App.shift_down() then
           Selection1 = {line=Cursor1.line, pos=Cursor1.pos}
         end
-        Cursor1.line = line_index
-        Cursor1.pos = Text.to_pos_on_line(line, x, y)
+        Cursor1 = {line=line_index, pos=Text.to_pos_on_line(line, x, y)}
         if not App.shift_down() then
           Selection1 = {line=Cursor1.line, pos=Cursor1.pos}
         end
@@ -296,8 +295,7 @@ function App.mousereleased(x,y, button)
     for line_index,line in ipairs(Lines) do
       if line.mode == 'text' then
         if Text.in_line(line, x,y) then
-          Cursor1.line = line_index
-          Cursor1.pos = Text.to_pos_on_line(line, x, y)
+          Cursor1 = {line=line_index, pos=Text.to_pos_on_line(line, x, y)}
           if Text.eq1(Cursor1, Selection1) and not App.shift_down() then
             Selection1 = {}
           end