about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
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)
92'>92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132