forked from qt-creator/qt-creator
CppEditor: Avoid auto insertion of '}' in empty line
...when typing '{'.
Change-Id: Ia1d3bcd7440c96ed3c8c1479148dd74d3d291689
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -143,9 +143,13 @@ bool MatchingText::contextAllowsAutoParentheses(const QTextCursor &cursor,
|
||||
if (!textToInsert.isEmpty())
|
||||
ch = textToInsert.at(0);
|
||||
|
||||
if (ch == QLatin1Char('{') && cursor.block().text().trimmed().isEmpty())
|
||||
return false; // User just might want to wrap up some lines.
|
||||
|
||||
if (!shouldInsertMatchingText(cursor) && ch != QLatin1Char('\'') && ch != QLatin1Char('"'))
|
||||
return false;
|
||||
else if (isInCommentHelper(cursor))
|
||||
|
||||
if (isInCommentHelper(cursor))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user