Skip to content

Commit 8c0220e

Browse files
committed
Fix TextEdit column index out of bound if column length changes during selection
1 parent a60fc7f commit 8c0220e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

scene/gui/text_edit.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -3445,6 +3445,7 @@ void TextEdit::set_line(int p_line, const String &p_new_text) {
34453445

34463446
if (has_selection(i) && p_line == get_selection_to_line(i) && get_selection_to_column(i) > text[p_line].length()) {
34473447
carets.write[i].selection.to_column = text[p_line].length();
3448+
carets.write[i].selection.selecting_column = CLAMP(carets[i].selection.selecting_column, 0, text[p_line].length());
34483449
}
34493450
}
34503451
end_complex_operation();

0 commit comments

Comments
 (0)