bugfix: up-arrow when cursor straddles a wrapping line

We can have multiple rects corresponding to the same location. But only
one of them has show_cursor enabled. This disambiguates which one we
mean.

With the current rect-based design, it's much harder to get 2 cursors
than I thought.
This commit is contained in:
Kartik K. Agaram 2024-09-15 14:37:45 -07:00
parent 0030e5d4f5
commit 9d8a518085
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 then
if c.pos == loc.pos and c.show_cursor then
return editor.left + c.x, y + c.y
end
end