From 93c15f48dc38423041b00c55cbef885a73c9d025 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 17 Oct 2022 06:45:38 +0200 Subject: [PATCH] Editor: ensure cursor is visible after handling backspace Fixes: QTCREATORBUG-28316 Change-Id: I1e8c9229704c700ad76f6906b1a220948c819c1b Reviewed-by: Reviewed-by: Orgad Shaneh --- src/plugins/texteditor/texteditor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 688d231ad79..7f69768d288 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -2673,9 +2673,10 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e) if (cursor.hasSelection()) { cursor.removeSelectedText(); setMultiTextCursor(cursor); - return; + } else { + d->handleBackspaceKey(); } - d->handleBackspaceKey(); + ensureCursorVisible(); return; } break;