forked from qt-creator/qt-creator
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:
@@ -232,7 +232,7 @@ bool AutoCompleter::contextAllowsAutoQuotes(const QTextCursor &cursor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// never insert ' into string literals, it adds spurious ' when writing contractions
|
// never insert ' into string literals, it adds spurious ' when writing contractions
|
||||||
if (textToInsert.at(0) == QLatin1Char('\''))
|
if (textToInsert.at(0) == QLatin1Char('\'') && quote != '\'')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (textToInsert.at(0) != quote || isCompleteStringLiteral(tokenText))
|
if (textToInsert.at(0) != quote || isCompleteStringLiteral(tokenText))
|
||||||
|
Reference in New Issue
Block a user