diff options
author | mae <qtc-committer@nokia.com> | 2008-12-09 15:41:01 +0100 |
---|---|---|
committer | mae <qtc-committer@nokia.com> | 2008-12-09 15:41:01 +0100 |
commit | 23872bb9974778b6a5e44569129e5622d1fa804d (patch) | |
tree | f10cc26ed52ceaf3ee72c22196606ac26759aff8 | |
parent | 3b315ed4d4e62e4be852f10fe45adeb7af673a94 (diff) | |
download | qt-creator-23872bb9974778b6a5e44569129e5622d1fa804d.tar.gz |
make indenting the selection a single undo/redo command
-rw-r--r-- | src/plugins/texteditor/basetexteditor.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 82a4201b26..ff9be893a7 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -2751,7 +2751,9 @@ void BaseTextEditor::handleBackspaceKey() void BaseTextEditor::format() { QTextCursor cursor = textCursor(); + cursor.beginEditBlock(); indent(document(), cursor, QChar::Null); + cursor.endEditBlock(); } void BaseTextEditor::unCommentSelection() @@ -3319,16 +3321,13 @@ void BaseTextEditor::collapse() TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout()); Q_ASSERT(documentLayout); QTextBlock block = textCursor().block(); - qDebug() << "collapse at block" << block.blockNumber(); while (block.isValid()) { - qDebug() << "test block" << block.blockNumber(); if (TextBlockUserData::canCollapse(block) && block.next().isVisible()) { if ((block.next().userState()) >> 8 <= (textCursor().block().userState() >> 8)) break; } block = block.previous(); } - qDebug() << "found" << block.blockNumber(); if (block.isValid()) { TextBlockUserData::doCollapse(block, false); d->moveCursorVisible(); |