From 315164c6191ac25eccf54c4378451e8acf24fbfc Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 27 Feb 2023 08:58:28 +0200 Subject: [PATCH] [TextEdit / IME] Check selection before deleting to avoid unnecessary error messages. --- scene/gui/text_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index ebca8296a09..7ab33d5c6cb 100644 --- a/scene/gui/text_edit.cpp +++ b/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(); }