diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2010-11-12 11:05:10 +0100 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2010-11-12 11:07:04 +0100 |
commit | 02dd995dad73059102d3444e05626bcbc7c90f67 (patch) | |
tree | 2fe03b423abdf283af3e65db17bcdce835273b75 /src/plugins/qmljseditor/qmljsautocompleter.cpp | |
parent | efb3d22c92749bbcde68f26ef265979bf89ac775 (diff) | |
download | qt-creator-02dd995dad73059102d3444e05626bcbc7c90f67.tar.gz |
QmlJS: Don't autoinsert ' in string literals.
Task-number: QTCREATORBUG-2155
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/plugins/qmljseditor/qmljsautocompleter.cpp')
-rw-r--r-- | src/plugins/qmljseditor/qmljsautocompleter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/qmljseditor/qmljsautocompleter.cpp b/src/plugins/qmljseditor/qmljsautocompleter.cpp index fd9d686d9a..836e5e0ef9 100644 --- a/src/plugins/qmljseditor/qmljsautocompleter.cpp +++ b/src/plugins/qmljseditor/qmljsautocompleter.cpp @@ -183,6 +183,10 @@ bool AutoCompleter::doContextAllowsAutoParentheses(const QTextCursor &cursor, const QStringRef tokenText = blockText.midRef(token.offset, token.length); const QChar quote = tokenText.at(0); + // never insert ' into string literals, it adds spurious ' when writing contractions + if (ch == QLatin1Char('\'')) + return false; + if (ch != quote || isCompleteStringLiteral(tokenText)) break; |