TextEdit: Moving between words now works across lines.
Fixes #10403
(cherry picked from commit 3f2d806b02
)
This commit is contained in:
parent
f6575f8d9a
commit
2ab7a6feb0
1 changed files with 14 additions and 0 deletions
|
@ -2037,6 +2037,13 @@ void TextEdit::_input_event(const InputEvent &p_input_event) {
|
||||||
#endif
|
#endif
|
||||||
bool prev_char = false;
|
bool prev_char = false;
|
||||||
int cc = cursor.column;
|
int cc = cursor.column;
|
||||||
|
|
||||||
|
if (cc == 0 && cursor.line > 0) {
|
||||||
|
cursor_set_line(cursor.line - 1);
|
||||||
|
cursor_set_column(text[cursor.line].length());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
while (cc > 0) {
|
while (cc > 0) {
|
||||||
|
|
||||||
bool ischar = _is_text_char(text[cursor.line][cc - 1]);
|
bool ischar = _is_text_char(text[cursor.line][cc - 1]);
|
||||||
|
@ -2094,6 +2101,13 @@ void TextEdit::_input_event(const InputEvent &p_input_event) {
|
||||||
#endif
|
#endif
|
||||||
bool prev_char = false;
|
bool prev_char = false;
|
||||||
int cc = cursor.column;
|
int cc = cursor.column;
|
||||||
|
|
||||||
|
if (cc == text[cursor.line].length() && cursor.line < text.size() - 1) {
|
||||||
|
cursor_set_line(cursor.line + 1);
|
||||||
|
cursor_set_column(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
while (cc < text[cursor.line].length()) {
|
while (cc < text[cursor.line].length()) {
|
||||||
|
|
||||||
bool ischar = _is_text_char(text[cursor.line][cc]);
|
bool ischar = _is_text_char(text[cursor.line][cc]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue