mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Fix crash when selecting lines in text edit
(cherry picked from commit 6b7008b73b)
This commit is contained in:
@@ -7153,7 +7153,9 @@ void TextEdit::_update_selection_mode_line() {
|
|||||||
if (line < carets[caret_idx].selection.selecting_line) {
|
if (line < carets[caret_idx].selection.selecting_line) {
|
||||||
/* Caret is above us. */
|
/* Caret is above us. */
|
||||||
set_caret_line(line - 1, false, true, 0, caret_idx);
|
set_caret_line(line - 1, false, true, 0, caret_idx);
|
||||||
carets.write[caret_idx].selection.selecting_column = text[get_selection_line(caret_idx)].length();
|
carets.write[caret_idx].selection.selecting_column = has_selection(caret_idx)
|
||||||
|
? text[get_selection_line(caret_idx)].length()
|
||||||
|
: 0;
|
||||||
} else {
|
} else {
|
||||||
/* Caret is below us. */
|
/* Caret is below us. */
|
||||||
set_caret_line(line + 1, false, true, 0, caret_idx);
|
set_caret_line(line + 1, false, true, 0, caret_idx);
|
||||||
|
|||||||
Reference in New Issue
Block a user