forked from qt-creator/qt-creator
Fix inserting on extra curly brace upon pressing enter key.
Special handling of the case in which the current token is Token::RightBrace. This works in every case *except* for nested braces without separator between them. Change-Id: Ief625086c4d33ba77b36b1181e78cad124feb7a9 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
@@ -179,6 +179,9 @@ bool AutoCompleter::contextAllowsAutoParentheses(const QTextCursor &cursor,
|
|||||||
case Token::Comment:
|
case Token::Comment:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
case Token::RightBrace:
|
||||||
|
return false;
|
||||||
|
|
||||||
case Token::String: {
|
case Token::String: {
|
||||||
const QString blockText = cursor.block().text();
|
const QString blockText = cursor.block().text();
|
||||||
const QStringRef tokenText = blockText.midRef(token.offset, token.length);
|
const QStringRef tokenText = blockText.midRef(token.offset, token.length);
|
||||||
|
|||||||
Reference in New Issue
Block a user