about summary refs log tree commit diff stats
path: root/edit.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-06-03 10:36:05 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-06-03 10:36:05 -0700
commit3114176ebd5b9895b5f67c759a2a705f673a4ac0 (patch)
treef8a6a60a8cd0165f5aa7b70fea1c267f469fcca6 /edit.lua
parent541519a9986fe5c85d6b03fc8cf993ba8e950b0c (diff)
downloadview.love-3114176ebd5b9895b5f67c759a2a705f673a4ac0.tar.gz
change how we handle clicks above top margin
Diffstat (limited to 'edit.lua')
-rw-r--r--edit.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/edit.lua b/edit.lua
index 3e92a54..ddd17c1 100644
--- a/edit.lua
+++ b/edit.lua
@@ -227,6 +227,17 @@ function edit.mouse_press(State, x,y, mouse_button)
     return
   end
 
+  if y < State.top then
+    State.old_cursor1 = State.cursor1
+    State.old_selection1 = State.selection1
+    State.mousepress_shift = App.shift_down()
+    State.selection1 = {
+        line=1,
+        pos=1,
+    }
+    return
+  end
+
   for line_index,line in ipairs(State.lines) do
     if line.mode == 'text' then
       if Text.in_line(State, line_index, x,y) then