commit 19ddc081c19cc688d6c4374b71dd8ffff608af3d
parent 8e91e26cc514b45568c1dad742a6ff352434322f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 28 Mar 2024 16:01:48 +0100
tweaks: rename a variable, to be more readable
Diffstat:
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/color.c b/src/color.c
@@ -240,7 +240,7 @@ void check_the_multis(linestruct *line)
char *afterstart;
/* If there is no syntax or no multiline regex, there is nothing to do. */
- if (openfile->syntax == NULL || openfile->syntax->nmultis == 0)
+ if (!openfile->syntax || openfile->syntax->multiscore == 0)
return;
if (line->multidata == NULL) {
@@ -293,7 +293,7 @@ void precalc_multicolorinfo(void)
regmatch_t startmatch, endmatch;
linestruct *line, *tailline;
- if (!openfile->syntax || openfile->syntax->nmultis == 0 || ISSET(NO_SYNTAX))
+ if (!openfile->syntax || openfile->syntax->multiscore == 0 || ISSET(NO_SYNTAX))
return;
//#define TIMEPRECALC 123
@@ -305,7 +305,7 @@ void precalc_multicolorinfo(void)
/* For each line, allocate cache space for the multiline-regex info. */
for (line = openfile->filetop; line != NULL; line = line->next)
if (!line->multidata)
- line->multidata = nmalloc(openfile->syntax->nmultis * sizeof(short));
+ line->multidata = nmalloc(openfile->syntax->multiscore * sizeof(short));
for (ink = openfile->syntax->color; ink != NULL; ink = ink->next) {
/* If this is not a multi-line regex, skip it. */
diff --git a/src/definitions.h b/src/definitions.h
@@ -444,7 +444,7 @@ typedef struct syntaxtype {
#endif
colortype *color;
/* The colors and their regexes used in this syntax. */
- short nmultis;
+ short multiscore;
/* How many multiline regex strings this syntax has. */
struct syntaxtype *next;
/* Next syntax. */
diff --git a/src/nano.c b/src/nano.c
@@ -1518,7 +1518,7 @@ void inject(char *burst, size_t count)
if (thisline == openfile->filebot && !ISSET(NO_NEWLINES)) {
new_magicline();
#ifdef ENABLE_COLOR
- if (margin || (openfile->syntax && openfile->syntax->nmultis))
+ if (margin || (openfile->syntax && openfile->syntax->multiscore))
#else
if (margin)
#endif
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -679,7 +679,7 @@ void begin_new_syntax(char *ptr)
live_syntax->comment = copy_of(GENERAL_COMMENT_CHARACTER);
#endif
live_syntax->color = NULL;
- live_syntax->nmultis = 0;
+ live_syntax->multiscore = 0;
/* Hook the new syntax in at the top of the list. */
live_syntax->next = syntaxes;
@@ -1223,8 +1223,8 @@ void parse_rule(char *ptr, int rex_flags)
/* For a multiline rule, give it a number and increase the count. */
if (expectend) {
- newcolor->id = live_syntax->nmultis;
- live_syntax->nmultis++;
+ newcolor->id = live_syntax->multiscore;
+ live_syntax->multiscore++;
}
}
}
diff --git a/src/winio.c b/src/winio.c
@@ -2595,8 +2595,8 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col)
const colortype *varnish = openfile->syntax->color;
/* If there are multiline regexes, make sure this line has a cache. */
- if (openfile->syntax->nmultis > 0 && line->multidata == NULL)
- line->multidata = nmalloc(openfile->syntax->nmultis * sizeof(short));
+ if (openfile->syntax->multiscore > 0 && line->multidata == NULL)
+ line->multidata = nmalloc(openfile->syntax->multiscore * sizeof(short));
/* Iterate through all the coloring regexes. */
for (; varnish != NULL; varnish = varnish->next) {