mirror of git://git.sv.gnu.org/nano.git
tweaks: rename a variable, to be more readable
This commit is contained in:
parent
8e91e26cc5
commit
19ddc081c1
|
@ -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. */
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue