Commit c1120587 authored by mae's avatar mae
Browse files

Merge commit 'origin/1.3'

Conflicts:
	src/plugins/cppeditor/cppeditor.cpp
parents 480c9a5b 3ef32636
......@@ -2011,12 +2011,13 @@
\list
\o Windows XP Service Pack 2
\o Windows Vista
\o (K)Ubuntu Linux 5.04
\o (K)Ubuntu Linux 7.04 32bit and 64 bit
\o Mac OS 10.4 and later
\endlist
\note Building the sources requires \bold{Qt 4.6.0} or later.
\note Building Qt Creator itself from source requires \bold{Qt 4.6.0} or later.
On Windows, MinGW 4.4 or Microsoft Visual Studio 2008 or later are required for compiling
Qt Creator itself.
*/
......
......@@ -747,7 +747,7 @@ bool Preprocessor::markGeneratedTokens(bool markGeneratedTokens,
out(*it);
}
if (! markGeneratedTokens && dot->newline())
if (! markGeneratedTokens && dot->f.newline)
processNewline(/*force = */ true);
}
......
......@@ -673,26 +673,30 @@ void CPPEditor::inAllRenameSelections(EditOperation operation,
{
cursor.beginEditBlock();
const int offset = cursor.position() - currentRenameSelection.cursor.anchor();
const int startOffset = cursor.selectionStart() - currentRenameSelection.cursor.anchor();
const int endOffset = cursor.selectionEnd() - currentRenameSelection.cursor.anchor();
const int length = endOffset - startOffset;
for (int i = 0; i < m_renameSelections.size(); ++i) {
QTextEdit::ExtraSelection &s = m_renameSelections[i];
int pos = s.cursor.anchor();
int endPos = s.cursor.position();
s.cursor.setPosition(s.cursor.anchor() + offset);
s.cursor.setPosition(pos + startOffset);
s.cursor.setPosition(pos + endOffset, QTextCursor::KeepAnchor);
switch (operation) {
case DeletePreviousChar:
s.cursor.deletePreviousChar();
--endPos;
endPos -= qMax(1, length);
break;
case DeleteChar:
s.cursor.deleteChar();
--endPos;
endPos -= qMax(1, length);
break;
case InsertText:
s.cursor.insertText(text);
endPos += text.length();
endPos += text.length() - length;
break;
}
......
......@@ -1007,8 +1007,10 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e)
cursor.insertBlock();
indent(document(), cursor, QChar::Null);
} else {
QString previousBlockText = cursor.block().text();
cursor.insertBlock();
// After inserting the block, to avoid duplicating whitespace on the same line
const QString previousBlockText = cursor.block().previous().text();
cursor.insertText(ts.indentationString(previousBlockText));
}
cursor.endEditBlock();
......
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