aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-02-01 09:25:15 +0100
committerEike Ziller <eike.ziller@qt.io>2019-02-01 10:18:33 +0000
commit5e054115ec61ad1ed7c70479323a38ad9e2af93b (patch)
treef6b0c8dcec7c50394fe47fc349d35440a3d14f06
parent59de3fcb6416dc0387e85a1852d1226ae507b7fe (diff)
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>
-rw-r--r--src/plugins/qmljseditor/qmljsautocompleter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/qmljseditor/qmljsautocompleter.cpp b/src/plugins/qmljseditor/qmljsautocompleter.cpp
index e50c268d2c..ac39e98f90 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))