about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-19 22:41:24 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-19 22:41:24 -0700
commita7c7fd6bce32256350cede6cea8c96ad6ecf1366 (patch)
treee1f999dbeed2f46132424a65c71030f6ff77c998 /text.lua
parente2b371ea37076c5bf7a7941f99aaf7eff3a5abdd (diff)
downloadtext.love-a7c7fd6bce32256350cede6cea8c96ad6ecf1366.tar.gz
bugfix: cursor past end of screen line
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/text.lua b/text.lua
index 6283763..c14a60d 100644
--- a/text.lua
+++ b/text.lua
@@ -302,7 +302,7 @@ function Text.move_cursor(line_index, line, mx, my)
       -- line position cursor on final character of screen line.
       -- (The final screen line positions past end of screen line as always.)
       if mx > Line_width and screen_line_index < #line.screen_line_starting_pos then
-        Cursor_pos = line.screen_line_starting_pos[screen_line_index+1] - 1
+        Cursor_pos = line.screen_line_starting_pos[screen_line_index+1]
         return
       end
       local s = string.sub(line.data, screen_line_starting_pos)