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
d11af451
Commit
d11af451
authored
Sep 16, 2009
by
Thorbjørn Lindeijer
Browse files
Fixed brace depth level to allow negative numbers
Done with mae.
parent
a575cb18
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cpphighlighter.cpp
View file @
d11af451
...
...
@@ -108,10 +108,8 @@ void CppHighlighter::highlightBlock(const QString &text)
}
else
if
(
tk
.
is
(
T_RPAREN
)
||
tk
.
is
(
T_RBRACE
)
||
tk
.
is
(
T_RBRACKET
))
{
const
QChar
c
(
tk
.
text
().
at
(
0
));
parentheses
.
append
(
Parenthesis
(
Parenthesis
::
Closed
,
c
,
tk
.
position
()));
if
(
tk
.
is
(
T_RBRACE
))
{
if
(
--
braceDepth
<
0
)
braceDepth
=
0
;
}
if
(
tk
.
is
(
T_RBRACE
))
--
braceDepth
;
}
bool
highlightCurrentWordAsPreprocessor
=
highlightAsPreprocessor
;
...
...
@@ -228,7 +226,7 @@ void CppHighlighter::highlightBlock(const QString &text)
if
(
currentState
!=
-
1
)
{
oldState
=
currentState
&
0xff
;
oldBraceDepth
=
currentState
>>
8
;
block
.
setUserState
(
qMax
(
0
,
(
oldBraceDepth
+
delta
)
<<
8
)
|
oldState
);
block
.
setUserState
(
(
(
oldBraceDepth
+
delta
)
<<
8
)
|
oldState
);
}
block
=
block
.
next
();
}
...
...
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