Commit 961fe9ed authored by mae's avatar mae
Browse files

Fix QKeySequence::DeleteStartOfWord in auto-indentation mode

The changes enables the auto-parentheses magic of normal
backspace also for the DeleteStartOfWord case.
parent 73320a43
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment