about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-29 14:38:45 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-29 14:38:45 -0700
commit0218980add27e3910b4fecc6715cedea81076081 (patch)
tree9d81547ce67224a2ceea214c1e378024f2470962 /text.lua
parent1e6b9e25aaa0a9012b72ffe013bd4961a04cea5d (diff)
downloadlines.love-0218980add27e3910b4fecc6715cedea81076081.tar.gz
click to the left of a line
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/text.lua b/text.lua
index 3490f7c..ddc5661 100644
--- a/text.lua
+++ b/text.lua
@@ -691,7 +691,6 @@ function Text.in_line(State, line_index, x,y)
   local line = State.lines[line_index]
   local line_cache = State.line_cache[line_index]
   if line_cache.starty == nil then return false end  -- outside current page
-  if x < State.left then return false end
   if y < line_cache.starty then return false end
   Text.populate_screen_line_starting_pos(State, line_index)
   return y < line_cache.starty + State.line_height*(#line_cache.screen_line_starting_pos - Text.screen_line_index(line_cache.screen_line_starting_pos, line_cache.startpos) + 1)
@@ -759,7 +758,7 @@ end
 -- oblivious to wrapping
 -- result: 1 to len+1
 function Text.nearest_cursor_pos(line, x, left)
-  if x == 0 then
+  if x < left then
     return 1
   end
   local len = utf8.len(line)