From d92055dde4b16de9456bb2d09c61bda937e06de8 Mon Sep 17 00:00:00 2001 From: Marco Benelli Date: Mon, 27 Apr 2015 10:36:29 +0200 Subject: [PATCH] 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 --- src/plugins/qmljseditor/qmljsautocompleter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/qmljseditor/qmljsautocompleter.cpp b/src/plugins/qmljseditor/qmljsautocompleter.cpp index f1e35b1310..6b4eb0060d 100644 --- a/src/plugins/qmljseditor/qmljsautocompleter.cpp +++ b/src/plugins/qmljseditor/qmljsautocompleter.cpp @@ -179,6 +179,9 @@ bool AutoCompleter::contextAllowsAutoParentheses(const QTextCursor &cursor, case Token::Comment: return false; + case Token::RightBrace: + return false; + case Token::String: { const QString blockText = cursor.block().text(); const QStringRef tokenText = blockText.midRef(token.offset, token.length); -- GitLab