Explorar o código

[TextEdit / IME] Check selection before deleting to avoid unnecessary error messages.

bruvzg %!s(int64=2) %!d(string=hai) anos
pai
achega
315164c619
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      scene/gui/text_edit.cpp

+ 1 - 1
scene/gui/text_edit.cpp

@@ -1548,7 +1548,7 @@ void TextEdit::_notification(int p_what) {
 				ime_text = DisplayServer::get_singleton()->ime_get_text();
 				ime_selection = DisplayServer::get_singleton()->ime_get_selection();
 
-				if (!ime_text.is_empty()) {
+				if (!ime_text.is_empty() && has_selection()) {
 					delete_selection();
 				}