QmlJS: Don't autoinsert ' in string literals.

Task-number: QTCREATORBUG-2155
Reviewed-by: Roberto Raggi
This commit is contained in:
Christian Kamm
2010-11-12 11:05:10 +01:00
parent efb3d22c92
commit 02dd995dad

View File

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