Skip to content
GitLab
Menu
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
ffaea3fc
Commit
ffaea3fc
authored
Apr 27, 2009
by
Thorbjørn Lindeijer
Browse files
Fixed flicker when updating highlighting of matching brace
By not removing it before setting an updated selection. Reviewed-by: mae
parent
8d59b0ab
Changes
1
Show whitespace changes
Inline
Side-by-side
src/plugins/texteditor/basetexteditor.cpp
View file @
ffaea3fc
...
...
@@ -2365,7 +2365,7 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
extraAreaWidth
,
viewport
()
->
height
());
painter
.
drawLine
(
extraAreaWidth
+
collapseBoxWidth
-
1
,
0
,
extraAreaWidth
+
collapseBoxWidth
-
1
,
viewport
()
->
height
());
QRect
cb
=
collapseBox
();
//
QRect cb = collapseBox();
// if (!cb.isEmpty()) {
// QPen pen(baseColor.value() < 128 ? Qt::white : Qt::black);
// pen.setWidth(2);
...
...
@@ -2428,10 +2428,17 @@ void BaseTextEditor::slotCursorPositionChanged()
}
else
if
(
d
->
m_contentsChanged
)
{
saveCurrentCursorPositionForNavigation
();
}
QList
<
QTextEdit
::
ExtraSelection
>
extraSelections
;
setExtraSelections
(
ParenthesesMatchingSelection
,
extraSelections
);
// clear
if
(
d
->
m_parenthesesMatchingEnabled
)
if
(
d
->
m_parenthesesMatchingEnabled
)
{
// Delay update when no matching is displayed yet, to avoid flicker
if
(
extraSelections
(
ParenthesesMatchingSelection
).
isEmpty
())
{
d
->
m_parenthesesMatchingTimer
->
start
(
50
);
}
else
{
_q_matchParentheses
();
}
}
QList
<
QTextEdit
::
ExtraSelection
>
extraSelections
;
if
(
d
->
m_highlightCurrentLine
)
{
QTextEdit
::
ExtraSelection
sel
;
...
...
@@ -3333,11 +3340,13 @@ void BaseTextEditor::_q_matchParentheses()
const
TextBlockUserData
::
MatchType
backwardMatchType
=
TextBlockUserData
::
matchCursorBackward
(
&
backwardMatch
);
const
TextBlockUserData
::
MatchType
forwardMatchType
=
TextBlockUserData
::
matchCursorForward
(
&
forwardMatch
);
if
(
backwardMatchType
==
TextBlockUserData
::
NoMatch
&&
forwardMatchType
==
TextBlockUserData
::
NoMatch
)
return
;
QList
<
QTextEdit
::
ExtraSelection
>
extraSelections
;
if
(
backwardMatchType
==
TextBlockUserData
::
NoMatch
&&
forwardMatchType
==
TextBlockUserData
::
NoMatch
)
{
setExtraSelections
(
ParenthesesMatchingSelection
,
extraSelections
);
// clear
return
;
}
if
(
backwardMatch
.
hasSelection
())
{
QTextEdit
::
ExtraSelection
sel
;
if
(
backwardMatchType
==
TextBlockUserData
::
Mismatch
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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