You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
core: Fix double caret rendering in justified text
The condition
visible_selection.start() >= *start && visible_selection.end() <= *end
was inaccurate, because the end of the selection is exclusive.
That caused the condition to be true for two adjacent boxes.
For instance:
box 1: from 0 to 6, "hello "
box 2: from 6 to 11, "world"
The caret was rendered for both boxes when it was at position 6.
When applying a correct condition (i.e. treating the end as exclusive)
there is a problem with rendering the caret at the very end of the text,
because the condition will not be triggered for any box
(position 11 in the example above).
That is why a condition specific to this case is added, i.e.
*end == text_len
When the box is the last box in the text, we are forcing
the caret to be rendered.
0 commit comments