forked from qt-creator/qt-creator
QmlJS: Don't autoinsert ' in string literals.
Task-number: QTCREATORBUG-2155 Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -183,6 +183,10 @@ bool AutoCompleter::doContextAllowsAutoParentheses(const QTextCursor &cursor,
|
|||||||
const QStringRef tokenText = blockText.midRef(token.offset, token.length);
|
const QStringRef tokenText = blockText.midRef(token.offset, token.length);
|
||||||
const QChar quote = tokenText.at(0);
|
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))
|
if (ch != quote || isCompleteStringLiteral(tokenText))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user