Don't insert automatic parenthesis in comments and strings

This commit is contained in:
Thorbjørn Lindeijer
2009-09-16 13:56:34 +02:00
parent 2f50581734
commit 14b081f700
4 changed files with 23 additions and 6 deletions

View File

@@ -1268,6 +1268,13 @@ bool CPPEditor::isElectricCharacter(const QChar &ch) const
return false;
}
bool CPPEditor::contextAllowsAutoParenthesis(const QTextCursor &cursor) const
{
CPlusPlus::TokenUnderCursor tokenUnderCursor;
const SimpleToken tk = tokenUnderCursor(cursor);
return !(tk.isComment() || tk.isLiteral());
}
void CPPEditor::indentInsertedText(const QTextCursor &tc)
{
indent(tc.document(), tc, QChar::Null);