summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorPaul Trojahn <paul.trojahn@gmail.com>2019-03-09 19:45:06 +0100
committerPaul Trojahn <paul.trojahn@gmail.com>2019-03-09 20:08:40 +0100
commit8851e16f7508d27965bfb28647c982b7e3a8af81 (patch)
treefc373f9ba6d0ddc1fe0dcd2bda22276548f4f81a /scene/gui
parentd41cd57595c4f68838b8dcf27e66cb77476577ed (diff)
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
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/line_edit.cpp2
-rw-r--r--scene/gui/text_edit.cpp2
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<InputEvent> 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) {