forked from qt-creator/qt-creator
C++: Do not insert matching } within string
Regression from
commit a6aa287720
C++: Fine-tune auto insertion of '}'
Change-Id: I3ede8c7a1e3c73708d5d5a59c314e4b4596976b2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -326,6 +326,11 @@ static bool allowAutoClosingBrace(const QTextCursor &cursor,
|
||||
|
||||
int prevState;
|
||||
const Tokens tokens = getTokens(cursor, prevState);
|
||||
|
||||
const Token token = tokenAtPosition(tokens, cursor.positionInBlock());
|
||||
if (token.isStringLiteral())
|
||||
return false;
|
||||
|
||||
if (isAfterNamespaceDefinition(tokens, cursor.positionInBlock()))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user