mirror of
git://git.sv.gnu.org/nano.git
synced 2025-02-09 01:44:32 +03:00
tweaks: reshuffle a test to a better place
This commit is contained in:
parent
23595c8376
commit
2f80193d96
18
src/winio.c
18
src/winio.c
@ -2509,31 +2509,27 @@ void edit_draw(filestruct *fileptr, const char *converted,
|
|||||||
/* If there is no end, there is nothing to paint. */
|
/* If there is no end, there is nothing to paint. */
|
||||||
if (end_line == NULL)
|
if (end_line == NULL)
|
||||||
goto tail_of_loop;
|
goto tail_of_loop;
|
||||||
/* If the end is scrolled off to the left, next step. */
|
|
||||||
if (end_line == fileptr && endmatch.rm_eo <= from_x) {
|
|
||||||
fileptr->multidata[varnish->id] = CBEGINBEFORE;
|
|
||||||
goto step_two;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now paint the start of the line. However, if the end match
|
/* If the end is on a later line, paint whole line, and be done. */
|
||||||
* is on a different line, paint the whole line, and go on. */
|
|
||||||
if (end_line != fileptr) {
|
if (end_line != fileptr) {
|
||||||
mvwaddnstr(edit, row, margin, converted, -1);
|
mvwaddnstr(edit, row, margin, converted, -1);
|
||||||
fileptr->multidata[varnish->id] = CWHOLELINE;
|
fileptr->multidata[varnish->id] = CWHOLELINE;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, " Marking for id %i row %i as CWHOLELINE\n", varnish->id, row);
|
fprintf(stderr, " Marking for id %i row %i as CWHOLELINE\n", varnish->id, row);
|
||||||
#endif
|
#endif
|
||||||
/* Don't bother looking for any more starts. */
|
|
||||||
goto tail_of_loop;
|
goto tail_of_loop;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
/* Only if it is visible, paint the part to be coloured. */
|
||||||
|
if (endmatch.rm_eo > from_x) {
|
||||||
paintlen = actual_x(converted, strnlenpt(fileptr->data,
|
paintlen = actual_x(converted, strnlenpt(fileptr->data,
|
||||||
endmatch.rm_eo) - from_col);
|
endmatch.rm_eo) - from_col);
|
||||||
mvwaddnstr(edit, row, margin, converted, paintlen);
|
mvwaddnstr(edit, row, margin, converted, paintlen);
|
||||||
fileptr->multidata[varnish->id] = CBEGINBEFORE;
|
}
|
||||||
|
fileptr->multidata[varnish->id] = CBEGINBEFORE;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, " Marking for id %i row %i as CBEGINBEFORE\n", varnish->id, row);
|
fprintf(stderr, " Marking for id %i row %i as CBEGINBEFORE\n", varnish->id, row);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
step_two:
|
step_two:
|
||||||
/* Second step: look for starts on this line, but begin
|
/* Second step: look for starts on this line, but begin
|
||||||
* looking only after an end match, if there is one. */
|
* looking only after an end match, if there is one. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user