Merge pull request #54204 from Ev1lbl0w/bugfix-textedit_selection_mode_crash
This commit is contained in:
commit
b46a42b689
1 changed files with 2 additions and 0 deletions
|
@ -3697,8 +3697,10 @@ void TextEdit::set_selection_mode(SelectionMode p_mode, int p_line, int p_column
|
||||||
if (p_line >= 0) {
|
if (p_line >= 0) {
|
||||||
ERR_FAIL_INDEX(p_line, text.size());
|
ERR_FAIL_INDEX(p_line, text.size());
|
||||||
selection.selecting_line = p_line;
|
selection.selecting_line = p_line;
|
||||||
|
selection.selecting_column = CLAMP(selection.selecting_column, 0, text[selection.selecting_line].length());
|
||||||
}
|
}
|
||||||
if (p_column >= 0) {
|
if (p_column >= 0) {
|
||||||
|
ERR_FAIL_INDEX(selection.selecting_line, text.size());
|
||||||
ERR_FAIL_INDEX(p_column, text[selection.selecting_line].length());
|
ERR_FAIL_INDEX(p_column, text[selection.selecting_line].length());
|
||||||
selection.selecting_column = p_column;
|
selection.selecting_column = p_column;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue