about summary refs log tree commit diff stats
path: root/source_text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2024-02-08 02:54:28 -0800
committerKartik K. Agaram <vc@akkartik.com>2024-02-08 02:54:28 -0800
commit9d1bea29411b63509daeff5e873840069a379213 (patch)
treee578ac43677921c74eb43c5c93117928ff3e439f /source_text.lua
parentd27c03373ccf10e3f0ee7b4e613099062062036e (diff)
parent6b33c9e22310cd50c5e68b411e6473a8309ffe00 (diff)
downloadview.love-9d1bea29411b63509daeff5e873840069a379213.tar.gz
Merge text.love
Diffstat (limited to 'source_text.lua')
-rw-r--r--source_text.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/source_text.lua b/source_text.lua
index b22d358..7c1838c 100644
--- a/source_text.lua
+++ b/source_text.lua
@@ -798,7 +798,7 @@ function Text.to_pos_on_line(State, line_index, mx, my)
       -- (The final screen line positions past end of screen line as always.)
       if screen_line_index < #line_cache.screen_line_starting_pos and mx > State.left + Text.screen_line_width(State, line_index, screen_line_index) then
 --?         print('past end of non-final line; return')
-        return line_cache.screen_line_starting_pos[screen_line_index+1]-1
+        return line_cache.screen_line_starting_pos[screen_line_index+1]
       end
       local s = string.sub(line.data, screen_line_starting_byte_offset)
 --?       print('return', mx, Text.nearest_cursor_pos(State.font, s, mx, State.left), '=>', screen_line_starting_pos + Text.nearest_cursor_pos(State.font, s, mx, State.left) - 1)