ensure visibility for extra blocks that are auto inserted

This commit is contained in:
mae
2009-09-17 12:47:16 +02:00
parent 061865efa4
commit 554f4fe679
4 changed files with 22 additions and 9 deletions

View File

@@ -1356,13 +1356,13 @@ bool CPPEditor::autoBackspace(QTextCursor &cursor)
return false;
}
void CPPEditor::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor)
int CPPEditor::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor)
{
if (characterAt(cursor.position()-1) != QLatin1Char('{'))
return;
return 0;
if (!contextAllowsAutoParentheses(cursor))
return;
return 0;
// verify that we indeed do have an extra opening brace in the document
@@ -1387,7 +1387,9 @@ void CPPEditor::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor)
}
cursor.setPosition(pos);
m_allowSkippingOfBlockEnd = true;
return 1;
}
return 0;
}
bool CPPEditor::contextAllowsAutoParentheses(const QTextCursor &cursor) const