forked from qt-creator/qt-creator
Merge commit 'origin/1.3'
Conflicts: src/plugins/cppeditor/cppeditor.cpp
This commit is contained in:
@@ -2011,12 +2011,13 @@
|
|||||||
\list
|
\list
|
||||||
\o Windows XP Service Pack 2
|
\o Windows XP Service Pack 2
|
||||||
\o Windows Vista
|
\o Windows Vista
|
||||||
\o (K)Ubuntu Linux 5.04
|
|
||||||
\o (K)Ubuntu Linux 7.04 32bit and 64 bit
|
\o (K)Ubuntu Linux 7.04 32bit and 64 bit
|
||||||
\o Mac OS 10.4 and later
|
\o Mac OS 10.4 and later
|
||||||
\endlist
|
\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);
|
out(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! markGeneratedTokens && dot->newline())
|
if (! markGeneratedTokens && dot->f.newline)
|
||||||
processNewline(/*force = */ true);
|
processNewline(/*force = */ true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -673,26 +673,30 @@ void CPPEditor::inAllRenameSelections(EditOperation operation,
|
|||||||
{
|
{
|
||||||
cursor.beginEditBlock();
|
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) {
|
for (int i = 0; i < m_renameSelections.size(); ++i) {
|
||||||
QTextEdit::ExtraSelection &s = m_renameSelections[i];
|
QTextEdit::ExtraSelection &s = m_renameSelections[i];
|
||||||
int pos = s.cursor.anchor();
|
int pos = s.cursor.anchor();
|
||||||
int endPos = s.cursor.position();
|
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) {
|
switch (operation) {
|
||||||
case DeletePreviousChar:
|
case DeletePreviousChar:
|
||||||
s.cursor.deletePreviousChar();
|
s.cursor.deletePreviousChar();
|
||||||
--endPos;
|
endPos -= qMax(1, length);
|
||||||
break;
|
break;
|
||||||
case DeleteChar:
|
case DeleteChar:
|
||||||
s.cursor.deleteChar();
|
s.cursor.deleteChar();
|
||||||
--endPos;
|
endPos -= qMax(1, length);
|
||||||
break;
|
break;
|
||||||
case InsertText:
|
case InsertText:
|
||||||
s.cursor.insertText(text);
|
s.cursor.insertText(text);
|
||||||
endPos += text.length();
|
endPos += text.length() - length;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1007,8 +1007,10 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e)
|
|||||||
cursor.insertBlock();
|
cursor.insertBlock();
|
||||||
indent(document(), cursor, QChar::Null);
|
indent(document(), cursor, QChar::Null);
|
||||||
} else {
|
} else {
|
||||||
QString previousBlockText = cursor.block().text();
|
|
||||||
cursor.insertBlock();
|
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.insertText(ts.indentationString(previousBlockText));
|
||||||
}
|
}
|
||||||
cursor.endEditBlock();
|
cursor.endEditBlock();
|
||||||
|
Reference in New Issue
Block a user