Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

This commit is contained in:
Friedemann Kleint
2009-07-16 09:25:16 +02:00

View File

@@ -617,8 +617,10 @@ void ScriptEditor::indentBlock(QTextDocument *, QTextBlock block, QChar typedCha
{ {
TextEditor::TabSettings ts = tabSettings(); TextEditor::TabSettings ts = tabSettings();
if (typedChar == QLatin1Char('}')) { if (typedChar == QLatin1Char('}')
QTextCursor tc = textCursor(); || ((typedChar == QChar::Null) && block.text().trimmed() == "}")) {
QTextCursor tc(block);
if (TextEditor::TextBlockUserData::findPreviousBlockOpenParenthesis(&tc)) { if (TextEditor::TextBlockUserData::findPreviousBlockOpenParenthesis(&tc)) {
const QString text = tc.block().text(); const QString text = tc.block().text();
int indent = ts.columnAt(text, ts.firstNonSpace(text)); int indent = ts.columnAt(text, ts.firstNonSpace(text));