scenario:
Before this commit the word would be highlighted twice:
Now it shows up at the right place.
IM7UEBMKYG6UT2MS34ZUVM5ZLN5YUZXOHJ6GVUSFMHRAK3JKULBQC
if pos <= State.cursor1.pos and pos + frag_len >= State.cursor1.pos then
if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos then
Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
elseif pos + frag_len == State.cursor1.pos then
-- Show cursor at end of line.
-- This place also catches end of wrapping screen lines. That doesn't seem worth distinguishing.
-- It seems useful to see a cursor whether your eye is on the left or right margin.
if pos <= State.cursor1.pos and pos + frag_len >= State.cursor1.pos then
if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos then
Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
elseif pos + frag_len == State.cursor1.pos then
-- Show cursor at end of line.
-- This place also catches end of wrapping screen lines. That doesn't seem worth distinguishing.
-- It seems useful to see a cursor whether your eye is on the left or right margin.