Handling end-of-text special case in TextArea.Select(). Fixes #958

This commit is contained in:
Oliver 2024-04-02 22:13:23 +02:00
parent e804876934
commit fec4f00cf0
1 changed files with 3 additions and 1 deletions

View File

@ -714,7 +714,8 @@ RowLoop:
length = -length
}
if start >= index+lineIndex && start < index+lineIndex+length-pos[1] ||
end >= index+lineIndex && end < index+lineIndex+length-pos[1] {
end >= index+lineIndex && end < index+lineIndex+length-pos[1] ||
next[0] == 1 && (start == t.length || end == t.length) { // Special case for the end of the text.
break
}
lineIndex += length - pos[1]
@ -743,6 +744,7 @@ RowLoop:
index += len(cluster)
column += width
}
row++
}
if t.cursor.row < 0 {