fix smart backspace handling

The smart backspace handling required a preceeding
non empty text block. In this case, the fix introduces
a standard backspace (deletePreviousCharacter).

Reviewed-by: dt
This commit is contained in:
mae
2010-01-28 16:27:57 +01:00
parent 6fe1f5b96c
commit b932615ca0

View File

@@ -3749,9 +3749,10 @@ void BaseTextEditor::handleBackspaceKey()
cursor.setPosition(currentBlock.position(), QTextCursor::KeepAnchor);
cursor.insertText(tabSettings.indentationString(previousNonEmptyBlockText));
cursor.endEditBlock();
break;
return;
}
}
cursor.deletePreviousChar();
}
void BaseTextEditor::wheelEvent(QWheelEvent *e)
@@ -3918,6 +3919,8 @@ bool BaseTextEditor::autoBackspace(QTextCursor &cursor)
d->m_allowSkippingOfBlockEnd = false;
int pos = cursor.position();
if (pos == 0)
return false;
QTextCursor c = cursor;
c.setPosition(pos - 1);