From d717e7be04e48cfb71a389f1cc65186aa40def3c Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 24 Apr 2024 14:27:23 +0200 Subject: [PATCH] TextEditor: fix backspace on block start Amends ec88d279a8d52189685008c8fe46371d13d2505f Change-Id: I7d83b5ffa617f8d45acc6998ce674b1afcf3a31b Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 1d90c7481f2..bea58df3c88 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -6876,7 +6876,8 @@ void TextEditorWidgetPrivate::handleBackspaceKey() } } } else if (typingSettings.m_smartBackspaceBehavior == TypingSettings::BackspaceUnindents) { - if (c.positionInBlock() > TabSettings::firstNonSpace(c.block().text())) { + if (c.positionInBlock() == 0 + || c.positionInBlock() > TabSettings::firstNonSpace(c.block().text())) { if (cursorWithinSnippet) c.beginEditBlock(); c.deletePreviousChar();