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

pull/966/head
Oliver 1 month ago
parent e804876934
commit fec4f00cf0

@ -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 {

Loading…
Cancel
Save