Merge pull request #14983 from Paulb23/keyboard_selection_issue_14675
Fixed keyboard word selection when at the start/end of line, issue 14675
This commit is contained in:
commit
d7d8fc6c20
|
@ -2581,11 +2581,8 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
|||
if (cc == 0 && cursor.line > 0) {
|
||||
cursor_set_line(cursor.line - 1);
|
||||
cursor_set_column(text[cursor.line].length());
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
while (cc > 0) {
|
||||
|
||||
bool ischar = _is_text_char(text[cursor.line][cc - 1]);
|
||||
|
||||
if (prev_char && !ischar)
|
||||
|
@ -2594,8 +2591,8 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
|||
prev_char = ischar;
|
||||
cc--;
|
||||
}
|
||||
|
||||
cursor_set_column(cc);
|
||||
}
|
||||
|
||||
} else if (cursor.column == 0) {
|
||||
|
||||
|
@ -2645,11 +2642,8 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
|||
if (cc == text[cursor.line].length() && cursor.line < text.size() - 1) {
|
||||
cursor_set_line(cursor.line + 1);
|
||||
cursor_set_column(0);
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
while (cc < text[cursor.line].length()) {
|
||||
|
||||
bool ischar = _is_text_char(text[cursor.line][cc]);
|
||||
|
||||
if (prev_char && !ischar)
|
||||
|
@ -2657,8 +2651,8 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
|||
prev_char = ischar;
|
||||
cc++;
|
||||
}
|
||||
|
||||
cursor_set_column(cc);
|
||||
}
|
||||
|
||||
} else if (cursor.column == text[cursor.line].length()) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue