From 8851e16f7508d27965bfb28647c982b7e3a8af81 Mon Sep 17 00:00:00 2001 From: Paul Trojahn Date: Sat, 9 Mar 2019 19:45:06 +0100 Subject: Support UTF-8 in TextEdit and LineEdit navigation This allows jumps over whole non ASCII words with Ctrl+Left/Right in a LineEdit or TextEdit. Fixes #25681 --- scene/gui/line_edit.cpp | 2 +- scene/gui/text_edit.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index bf6833e512..e84697b80f 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -43,7 +43,7 @@ static bool _is_text_char(CharType c) { - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_'; + return !is_symbol(c); } void LineEdit::_gui_input(Ref p_event) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 2bf2364873..92421dff35 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -50,7 +50,7 @@ inline bool _is_symbol(CharType c) { static bool _is_text_char(CharType c) { - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_'; + return !is_symbol(c); } static bool _is_whitespace(CharType c) { -- cgit v1.2.3