From a7c7fd6bce32256350cede6cea8c96ad6ecf1366 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 19 May 2022 22:41:24 -0700 Subject: [PATCH] bugfix: cursor past end of screen line --- text.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)