Commit 9ff527e2 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Check context when removing matching parentheses

Done with mae.
parent 66f2e323
......@@ -3272,12 +3272,18 @@ void BaseTextEditor::handleBackspaceKey()
if ((lookBehind == QLatin1Char('(') && lookAhead == QLatin1Char(')'))
|| (lookBehind == QLatin1Char('[') && lookAhead == QLatin1Char(']'))
|| (lookBehind == QLatin1Char('"') && lookAhead == QLatin1Char('"')
&& lookFurtherBehind!= QLatin1Char('\\'))) {
cursor.beginEditBlock();
cursor.deleteChar();
cursor.deletePreviousChar();
cursor.endEditBlock();
return;
&& lookFurtherBehind != QLatin1Char('\\'))
|| (lookBehind == QLatin1Char('\'') && lookAhead == QLatin1Char('\'')
&& lookFurtherBehind != QLatin1Char('\\'))) {
QTextCursor c = cursor;
c.setPosition(pos - 1);
if (contextAllowsAutoParentheses(c)) {
cursor.beginEditBlock();
cursor.deleteChar();
cursor.deletePreviousChar();
cursor.endEditBlock();
return;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment