Browse Source

Merge pull request #26848 from ptrojahn/utf8navigation

Support UTF-8 in TextEdit and LineEdit navigation
Rémi Verschelde 6 years ago
parent
commit
774a9fde84
2 changed files with 2 additions and 2 deletions
  1. 1 1
      scene/gui/line_edit.cpp
  2. 1 1
      scene/gui/text_edit.cpp

+ 1 - 1
scene/gui/line_edit.cpp

@@ -44,7 +44,7 @@
 
 
 static bool _is_text_char(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);
 }
 }
 
 
 void LineEdit::_gui_input(Ref<InputEvent> p_event) {
 void LineEdit::_gui_input(Ref<InputEvent> p_event) {

+ 1 - 1
scene/gui/text_edit.cpp

@@ -50,7 +50,7 @@ inline bool _is_symbol(CharType c) {
 
 
 static bool _is_text_char(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) {
 static bool _is_whitespace(CharType c) {