tweaks: move a function to before the first one that calls it

This commit is contained in:
Benno Schulenberg 2019-06-23 12:28:13 +02:00
parent d8c840692e
commit 1fcb9b99cf
2 changed files with 10 additions and 10 deletions

View File

@ -282,6 +282,15 @@ void color_update(void)
openfile->colorstrings = (sint == NULL ? NULL : sint->color);
}
/* Allocate and initialize (for the given line) the cache for multiline info. */
void set_up_multicache(linestruct *line)
{
line->multidata = (short *)nmalloc(openfile->syntax->nmultis * sizeof(short));
for (int index = 0; index < openfile->syntax->nmultis; index++)
line->multidata[index] = -1;
}
/* Determine whether the matches of multiline regexes are still the same,
* and if not, schedule a screen refresh, so things will be repainted. */
void check_the_multis(linestruct *line)
@ -329,15 +338,6 @@ void check_the_multis(linestruct *line)
}
}
/* Allocate (for one line) the cache space for multiline color regexes. */
void set_up_multicache(linestruct *line)
{
line->multidata = (short *)nmalloc(openfile->syntax->nmultis * sizeof(short));
for (int index = 0; index < openfile->syntax->nmultis; index++)
line->multidata[index] = -1;
}
/* Precalculate the multi-line start and end regex info so we can
* speed up rendering (with any hope at all...). */
void precalc_multicolorinfo(void)

View File

@ -242,8 +242,8 @@ bool is_valid_unicode(wchar_t wc);
void set_colorpairs(void);
void color_init(void);
void color_update(void);
void check_the_multis(linestruct *line);
void set_up_multicache(linestruct *line);
void check_the_multis(linestruct *line);
void precalc_multicolorinfo(void);
#endif