Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
13fbf13b
Commit
13fbf13b
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename a variable, to be more general and match one elsewhere
parent
96f50b8d
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/color.c
+10
-10
src/color.c
with
10 additions
and
10 deletions
+10
-10
src/color.c
View file @
13fbf13b
...
...
@@ -413,7 +413,7 @@ void precalc_multicolorinfo(void)
continue
;
for
(
fileptr
=
openfile
->
fileage
;
fileptr
!=
NULL
;
fileptr
=
fileptr
->
next
)
{
int
start
x
=
0
;
int
inde
x
=
0
;
int
linelen
=
strlen
(
fileptr
->
data
);
alloc_multidata_if_needed
(
fileptr
);
...
...
@@ -422,23 +422,23 @@ void precalc_multicolorinfo(void)
/* When the line contains a start match, look for an end, and if
* found, mark all the lines that are affected. */
while
(
regexec
(
ink
->
start
,
&
fileptr
->
data
[
start
x
],
1
,
&
startmatch
,
(
start
x
==
0
)
?
0
:
REG_NOTBOL
)
==
0
)
{
start
x
+=
startmatch
.
rm_eo
;
while
(
regexec
(
ink
->
start
,
&
fileptr
->
data
[
inde
x
],
1
,
&
startmatch
,
(
inde
x
==
0
)
?
0
:
REG_NOTBOL
)
==
0
)
{
inde
x
+=
startmatch
.
rm_eo
;
if
(
start
x
>
linelen
)
if
(
inde
x
>
linelen
)
break
;
/* If there is an end match on this line, mark the line, but
* continue looking for other starts after it. */
if
(
regexec
(
ink
->
end
,
&
fileptr
->
data
[
start
x
],
1
,
&
endmatch
,
(
start
x
==
0
)
?
0
:
REG_NOTBOL
)
==
0
)
{
if
(
regexec
(
ink
->
end
,
&
fileptr
->
data
[
inde
x
],
1
,
&
endmatch
,
(
inde
x
==
0
)
?
0
:
REG_NOTBOL
)
==
0
)
{
fileptr
->
multidata
[
ink
->
id
]
=
CSTARTENDHERE
;
start
x
+=
endmatch
.
rm_eo
;
inde
x
+=
endmatch
.
rm_eo
;
/* If both start and end are mere anchors, step ahead. */
if
(
startmatch
.
rm_so
==
startmatch
.
rm_eo
&&
endmatch
.
rm_so
==
endmatch
.
rm_eo
)
start
x
+=
1
;
inde
x
+=
1
;
continue
;
}
...
...
@@ -467,7 +467,7 @@ void precalc_multicolorinfo(void)
fileptr
->
multidata
[
ink
->
id
]
=
CBEGINBEFORE
;
/* Begin looking for a new start after the end match. */
start
x
=
endmatch
.
rm_eo
;
inde
x
=
endmatch
.
rm_eo
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help