From 7127e57bf8e2281059287e2e8b3c57b84ecfe978 Mon Sep 17 00:00:00 2001 From: Alfred Reinold Baudisch Date: Sat, 5 Nov 2022 08:55:01 +0100 Subject: Pass caret index when deleting selection with backspace Fixes and closes #67992 --- scene/gui/code_edit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scene') diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index 5f8f25154c..ea310f5a12 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -694,8 +694,8 @@ void CodeEdit::_backspace_internal(int p_caret) { return; } - if (has_selection()) { - delete_selection(); + if (has_selection(p_caret)) { + delete_selection(p_caret); return; } -- cgit v1.2.3