bugfix: handle cursor past end of line

This commit is contained in:
Kartik K. Agaram 2024-09-16 01:06:52 -07:00
parent 208cc02ed8
commit 99b04ae3c4
1 changed files with 1 additions and 1 deletions

View File

@ -282,7 +282,7 @@ function edit.to_coord(editor, loc) -- scans
-- text
for _,s in ipairs(rect.screen_line_rects) do
for _,c in ipairs(s.char_rects) do
if c.pos == loc.pos and c.data then
if c.pos == loc.pos and (c.data or c.pos == utf8.len(line.data)+1) then
return editor.left + c.x, y + c.y
end
end