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
81955e04
Commit
81955e04
authored
Jun 17, 2010
by
Leandro Melo
Browse files
Generic highlighter: Renaming a couple of methods.
parent
4fb15071
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/texteditor/generichighlighter/highlighter.cpp
View file @
81955e04
...
...
@@ -202,7 +202,7 @@ void Highlighter::iterateThroughRules(const QString &text,
if
(
rule
->
matchSucceed
(
text
,
length
,
progress
))
{
atLeastOneMatch
=
true
;
if
(
progress
->
w
illContinueLine
())
{
if
(
progress
->
isW
illContinueLine
())
{
createWillContinueBlock
();
progress
->
setWillContinueLine
(
false
);
}
else
{
...
...
@@ -247,7 +247,7 @@ void Highlighter::iterateThroughRules(const QString &text,
}
else
{
applyFormat
(
progress
->
offset
(),
1
,
m_currentContext
->
itemData
(),
m_currentContext
->
definition
());
if
(
progress
->
o
nlySpacesSoFar
()
&&
!
text
.
at
(
progress
->
offset
()).
isSpace
())
if
(
progress
->
isO
nlySpacesSoFar
()
&&
!
text
.
at
(
progress
->
offset
()).
isSpace
())
progress
->
setOnlySpacesSoFar
(
false
);
progress
->
incrementOffset
();
}
...
...
src/plugins/texteditor/generichighlighter/progressdata.cpp
View file @
81955e04
...
...
@@ -66,13 +66,13 @@ void ProgressData::restoreOffset()
void
ProgressData
::
setOnlySpacesSoFar
(
const
bool
onlySpaces
)
{
m_onlySpacesSoFar
=
onlySpaces
;
}
bool
ProgressData
::
o
nlySpacesSoFar
()
const
bool
ProgressData
::
isO
nlySpacesSoFar
()
const
{
return
m_onlySpacesSoFar
;
}
void
ProgressData
::
setWillContinueLine
(
const
bool
willContinue
)
{
m_willContinueLine
=
willContinue
;
}
bool
ProgressData
::
w
illContinueLine
()
const
bool
ProgressData
::
isW
illContinueLine
()
const
{
return
m_willContinueLine
;
}
void
ProgressData
::
setCaptures
(
const
QStringList
&
captures
)
...
...
src/plugins/texteditor/generichighlighter/progressdata.h
View file @
81955e04
...
...
@@ -50,10 +50,10 @@ public:
void
restoreOffset
();
void
setOnlySpacesSoFar
(
const
bool
onlySpaces
);
bool
o
nlySpacesSoFar
()
const
;
bool
isO
nlySpacesSoFar
()
const
;
void
setWillContinueLine
(
const
bool
willContinue
);
bool
w
illContinueLine
()
const
;
bool
isW
illContinueLine
()
const
;
void
setCaptures
(
const
QStringList
&
captures
);
const
QStringList
&
captures
()
const
;
...
...
src/plugins/texteditor/generichighlighter/rule.cpp
View file @
81955e04
...
...
@@ -162,7 +162,7 @@ bool Rule::charPredicateMatchSucceed(const QString &text,
bool
Rule
::
matchSucceed
(
const
QString
&
text
,
const
int
length
,
ProgressData
*
progress
)
const
{
if
(
m_firstNonSpace
&&
!
progress
->
o
nlySpacesSoFar
())
if
(
m_firstNonSpace
&&
!
progress
->
isO
nlySpacesSoFar
())
return
false
;
if
(
m_column
!=
-
1
&&
m_column
!=
progress
->
offset
())
...
...
@@ -170,7 +170,7 @@ bool Rule::matchSucceed(const QString &text, const int length, ProgressData *pro
int
original
=
progress
->
offset
();
if
(
doMatchSucceed
(
text
,
length
,
progress
))
{
if
(
progress
->
o
nlySpacesSoFar
()
&&
!
m_lookAhead
&&
m_consumesNonSpace
)
if
(
progress
->
isO
nlySpacesSoFar
()
&&
!
m_lookAhead
&&
m_consumesNonSpace
)
progress
->
setOnlySpacesSoFar
(
false
);
if
(
m_lookAhead
)
...
...
src/plugins/texteditor/generichighlighter/rule.h
View file @
81955e04
...
...
@@ -123,7 +123,7 @@ protected:
static
const
QLatin1Char
kN
;
static
const
QLatin1Char
kR
;
static
const
QLatin1Char
kT
;
static
const
QLatin1Char
kV
;
static
const
QLatin1Char
kV
;
private:
virtual
bool
doMatchSucceed
(
const
QString
&
text
,
...
...
tests/auto/generichighlighter/specificrules/tst_specificrules.cpp
View file @
81955e04
...
...
@@ -149,8 +149,8 @@ void tst_SpecificRules::testMatch(const Rule &rule, ProgressData *progress) cons
QTEST
(
rule
.
matchSucceed
(
s
,
s
.
length
(),
progress
),
"match"
);
QTEST
(
progress
->
offset
(),
"offset"
);
QTEST
(
progress
->
o
nlySpacesSoFar
(),
"only spaces"
);
QTEST
(
progress
->
w
illContinueLine
(),
"will continue"
);
QTEST
(
progress
->
isO
nlySpacesSoFar
(),
"only spaces"
);
QTEST
(
progress
->
isW
illContinueLine
(),
"will continue"
);
}
void
tst_SpecificRules
::
testDetectChar
()
...
...
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