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
fccfcccd
Commit
fccfcccd
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reshuffle an assignment and trim some comments
parent
03148804
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/winio.c
+10
-22
src/winio.c
with
10 additions
and
22 deletions
+10
-22
src/winio.c
View file @
fccfcccd
...
...
@@ -2420,40 +2420,30 @@ void edit_draw(filestruct *fileptr, const char *converted,
regmatch_t
startmatch
,
endmatch
;
/* The match positions of the start and end regexes. */
/* Assume nothing gets painted until proven otherwise below. */
fileptr
->
multidata
[
varnish
->
id
]
=
CNONE
;
/* First check the multidata of the preceding line -- it tells
* us about the situation so far, and thus what to do here. */
if
(
start_line
!=
NULL
&&
start_line
->
multidata
!=
NULL
)
{
if
(
start_line
->
multidata
[
varnish
->
id
]
==
CWHOLELINE
||
start_line
->
multidata
[
varnish
->
id
]
==
CENDAFTER
)
{
fileptr
->
multidata
[
varnish
->
id
]
=
C
NONE
;
start_line
->
multidata
[
varnish
->
id
]
==
CENDAFTER
||
start_line
->
multidata
[
varnish
->
id
]
=
=
C
WOULDBE
)
goto
seek_an_end
;
}
if
(
start_line
->
multidata
[
varnish
->
id
]
==
CNONE
||
start_line
->
multidata
[
varnish
->
id
]
==
CBEGINBEFORE
||
start_line
->
multidata
[
varnish
->
id
]
==
CSTARTENDHERE
)
{
fileptr
->
multidata
[
varnish
->
id
]
=
CNONE
;
start_line
->
multidata
[
varnish
->
id
]
==
CSTARTENDHERE
)
goto
step_two
;
}
}
/* The preceding line has no precalculated multidata. So, do
* some backtracking to find out what to paint. */
/* Assume nothing gets painted until proven otherwise below. */
fileptr
->
multidata
[
varnish
->
id
]
=
CNONE
;
/* First check if the beginning of the line is colored by a
* start on an earlier line, and an end on this line or later.
*
* So: find the first line before fileptr matching the start.
* If every match on that line is followed by an end, then go
* to step two. Otherwise, find a line after start_line that
* matches the end. If that line is not before fileptr, then
* paint the beginning of this line. */
/* First step: see if there is a line before current that
* matches 'start' and is not complemented by an 'end'. */
while
(
start_line
!=
NULL
&&
regexec
(
varnish
->
start
,
start_line
->
data
,
1
,
&
startmatch
,
0
)
==
REG_NOMATCH
)
{
/* There is no start; but if there is an end
on this line
,
/* There is no start
on this line
; but if there is an end,
* there is no need to look for starts on earlier lines. */
if
(
regexec
(
varnish
->
end
,
start_line
->
data
,
0
,
NULL
,
0
)
==
0
)
goto
step_two
;
...
...
@@ -2471,9 +2461,7 @@ void edit_draw(filestruct *fileptr, const char *converted,
start_line
->
multidata
[
varnish
->
id
]
==
CSTARTENDHERE
))
goto
step_two
;
/* Now start_line is the first line before fileptr containing
* a start match. Is there a start on that line not followed
* by an end on that line? */
/* Is there an uncomplemented start on the found line? */
while
(
TRUE
)
{
/* Begin searching for an end after the start match. */
index
+=
startmatch
.
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