aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2024-04-24 14:27:23 +0200
committerChristian Stenger <christian.stenger@qt.io>2024-04-24 14:20:12 +0000
commitd717e7be04e48cfb71a389f1cc65186aa40def3c (patch)
tree493e0f50e2420571cf2a02a70e16ab4090e8af85 /src
parent7f7d4889d26b11e26d066d870da73ba5912f2988 (diff)
TextEditor: fix backspace on block start
Amends ec88d279a8d52189685008c8fe46371d13d2505f Change-Id: I7d83b5ffa617f8d45acc6998ce674b1afcf3a31b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/texteditor/texteditor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp
index 1d90c7481f..bea58df3c8 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();