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
4bdc0664
Commit
4bdc0664
authored
May 27, 2009
by
mae
Browse files
Small fix for parentheses matching: give the syntaxhighlighter a chance
to update the parentheses information.
parent
43a14ac2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/texteditor/basetexteditor.cpp
View file @
4bdc0664
...
...
@@ -2552,7 +2552,9 @@ void BaseTextEditor::slotCursorPositionChanged()
if
(
extraSelections
(
ParenthesesMatchingSelection
).
isEmpty
())
{
d
->
m_parenthesesMatchingTimer
->
start
(
50
);
}
else
{
_q_matchParentheses
();
// use 0-timer, not direct call, to give the syntax highlighter a chance
// to update the parantheses information
d
->
m_parenthesesMatchingTimer
->
start
(
0
);
}
}
...
...
@@ -3536,6 +3538,7 @@ void BaseTextEditor::_q_matchParentheses()
return
;
qDebug
()
<<
"_q_matchParentheses()"
<<
textCursor
().
position
();
QTextCursor
backwardMatch
=
textCursor
();
QTextCursor
forwardMatch
=
textCursor
();
const
TextBlockUserData
::
MatchType
backwardMatchType
=
TextBlockUserData
::
matchCursorBackward
(
&
backwardMatch
);
...
...
@@ -3545,11 +3548,13 @@ void BaseTextEditor::_q_matchParentheses()
if
(
backwardMatchType
==
TextBlockUserData
::
NoMatch
&&
forwardMatchType
==
TextBlockUserData
::
NoMatch
)
{
setExtraSelections
(
ParenthesesMatchingSelection
,
extraSelections
);
// clear
qDebug
()
<<
"no match"
;
return
;
}
int
animatePosition
=
-
1
;
if
(
backwardMatch
.
hasSelection
())
{
qDebug
()
<<
"backward match"
;
QTextEdit
::
ExtraSelection
sel
;
if
(
backwardMatchType
==
TextBlockUserData
::
Mismatch
)
{
sel
.
cursor
=
backwardMatch
;
...
...
@@ -3578,6 +3583,7 @@ void BaseTextEditor::_q_matchParentheses()
}
if
(
forwardMatch
.
hasSelection
())
{
qDebug
()
<<
"forward match"
;
QTextEdit
::
ExtraSelection
sel
;
if
(
forwardMatchType
==
TextBlockUserData
::
Mismatch
)
{
sel
.
cursor
=
forwardMatch
;
...
...
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