From 5e054115ec61ad1ed7c70479323a38ad9e2af93b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 1 Feb 2019 09:25:15 +0100 Subject: [PATCH] QML: Fix auto-insertion of single quote After inserting a matching single quote it should not add yet another single quote when typing one explicitly. Change-Id: I568f02e4edbb78ef11665bb7f4a9f3b91cf9b887 Reviewed-by: Ulf Hermann Reviewed-by: David Schulz --- src/plugins/qmljseditor/qmljsautocompleter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmljseditor/qmljsautocompleter.cpp b/src/plugins/qmljseditor/qmljsautocompleter.cpp index e50c268d2ca..ac39e98f900 100644 --- a/src/plugins/qmljseditor/qmljsautocompleter.cpp +++ b/src/plugins/qmljseditor/qmljsautocompleter.cpp @@ -232,7 +232,7 @@ bool AutoCompleter::contextAllowsAutoQuotes(const QTextCursor &cursor, } // never insert ' into string literals, it adds spurious ' when writing contractions - if (textToInsert.at(0) == QLatin1Char('\'')) + if (textToInsert.at(0) == QLatin1Char('\'') && quote != '\'') return false; if (textToInsert.at(0) != quote || isCompleteStringLiteral(tokenText))