nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 1fcb9b99cf547058b5246c338dd60170f8935e20
parent d8c840692e75054531709a53ef10dfaf06fe0627
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 23 Jun 2019 12:28:13 +0200

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

Diffstat:
Msrc/color.c | 18+++++++++---------
Msrc/proto.h | 2+-
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/color.c b/src/color.c @@ -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) diff --git a/src/proto.h b/src/proto.h @@ -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