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 <ulf.hermann@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2019-02-01 09:25:15 +01:00
parent 59de3fcb64
commit 5e054115ec

View File

@@ -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))