Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
9ff527e2
Commit
9ff527e2
authored
Sep 16, 2009
by
Thorbjørn Lindeijer
Browse files
Check context when removing matching parentheses
Done with mae.
parent
66f2e323
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/texteditor/basetexteditor.cpp
View file @
9ff527e2
...
...
@@ -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
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment