tweaks: adjust whitespace after the previous change
parent
38d7362f20
commit
f6fbc1572d
23
src/winio.c
23
src/winio.c
|
@ -2398,7 +2398,6 @@ void edit_draw(filestruct *fileptr, const char *converted, int
|
|||
startmatch.rm_eo <= from_x)
|
||||
continue;
|
||||
|
||||
{
|
||||
start_col = (startmatch.rm_so <= from_x) ?
|
||||
0 : strnlenpt(fileptr->data,
|
||||
startmatch.rm_so) - from_col;
|
||||
|
@ -2411,12 +2410,10 @@ void edit_draw(filestruct *fileptr, const char *converted, int
|
|||
mvwaddnstr(edit, line, margin + start_col,
|
||||
thetext, paintlen);
|
||||
}
|
||||
}
|
||||
goto tail_of_loop;
|
||||
}
|
||||
|
||||
/* Second case: varnish is a multiline expression. */
|
||||
{
|
||||
const filestruct *start_line = fileptr->prev;
|
||||
/* The first line before fileptr that matches 'start'. */
|
||||
const filestruct *end_line = fileptr;
|
||||
|
@ -2503,8 +2500,8 @@ void edit_draw(filestruct *fileptr, const char *converted, int
|
|||
/* We've already checked that there is no end before fileptr
|
||||
* and after the start. But is there an end after the start
|
||||
* at all? We don't paint unterminated starts. */
|
||||
while (end_line != NULL && regexec(varnish->end,
|
||||
end_line->data, 1, &endmatch, 0) == REG_NOMATCH)
|
||||
while (end_line != NULL && regexec(varnish->end, end_line->data,
|
||||
1, &endmatch, 0) == REG_NOMATCH)
|
||||
end_line = end_line->next;
|
||||
|
||||
/* If no end was found, or it is too early, next step. */
|
||||
|
@ -2553,9 +2550,8 @@ void edit_draw(filestruct *fileptr, const char *converted, int
|
|||
|
||||
thetext = converted + actual_x(converted, start_col);
|
||||
|
||||
if (regexec(varnish->end, fileptr->data +
|
||||
startmatch.rm_eo, 1, &endmatch,
|
||||
(startmatch.rm_eo == 0) ?
|
||||
if (regexec(varnish->end, fileptr->data + startmatch.rm_eo,
|
||||
1, &endmatch, (startmatch.rm_eo == 0) ?
|
||||
0 : REG_NOTBOL) == 0) {
|
||||
/* Translate the end match to be relative to
|
||||
* the beginning of the line. */
|
||||
|
@ -2584,17 +2580,14 @@ void edit_draw(filestruct *fileptr, const char *converted, int
|
|||
continue;
|
||||
}
|
||||
|
||||
{
|
||||
/* There is no end on this line. But we haven't yet
|
||||
* looked for one on later lines. */
|
||||
/* There is no end on this line. But maybe on later lines? */
|
||||
end_line = fileptr->next;
|
||||
|
||||
while (end_line != NULL &&
|
||||
regexec(varnish->end, end_line->data,
|
||||
while (end_line != NULL && regexec(varnish->end, end_line->data,
|
||||
0, NULL, 0) == REG_NOMATCH)
|
||||
end_line = end_line->next;
|
||||
|
||||
/* If there is no end, we're done on this line. */
|
||||
/* If there is no end, we're done with this regex. */
|
||||
if (end_line == NULL)
|
||||
break;
|
||||
|
||||
|
@ -2608,8 +2601,6 @@ void edit_draw(filestruct *fileptr, const char *converted, int
|
|||
* bother checking for any more starts. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
tail_of_loop:
|
||||
wattroff(edit, varnish->attributes);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue