diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 235120ba4bd081659dafb50903dadaabe07af1a3..99c18a9bb37272837d3ab6cf1be7f41818310c52 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -962,6 +962,23 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e) return; } } + } else if (!ro + && e == QKeySequence::DeleteStartOfWord + && d->m_document->tabSettings().m_autoIndent + && !textCursor().hasSelection()){ + e->accept(); + QTextCursor c = textCursor(); + int pos = c.position(); + c.movePosition(QTextCursor::PreviousWord); + int targetpos = c.position(); + forever { + handleBackspaceKey(); + int cpos = textCursor().position(); + if (cpos == pos || cpos <= targetpos) + break; + pos = cpos; + } + return; } else switch (e->key()) { @@ -3289,7 +3306,7 @@ void BaseTextEditor::handleBackspaceKey() const TextEditor::TabSettings &tabSettings = d->m_document->tabSettings(); - if (autoBackspace(cursor)) + if (tabSettings.m_autoIndent && autoBackspace(cursor)) return; if (!tabSettings.m_smartBackspace) {