Precalculating the multiline-regex cache data for each buffer,

not just for the first.  This fixes Savannah bug #46511.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5500 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2015-12-20 21:10:41 +00:00
parent 72760159e7
commit 5737fe3461
4 changed files with 13 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2015-12-20 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (display_buffer), src/nano.c (main): Precalculate the
multiline-regex cache data for each buffer, not just for the first.
This fixes Savannah bug #46511.
2015-12-18 Benno Schulenberg <bensberg@justemail.net>
* src/color.c (color_init): Use less #ifdefs, and adjust indentation.
* src/color.c (set_colorpairs): Improve comments and rename vars.

View File

@ -456,9 +456,14 @@ void display_buffer(void)
titlebar(NULL);
#ifndef DISABLE_COLOR
/* Make sure we're using the buffer's associated colors, if
* applicable. */
/* Make sure we're using the buffer's associated colors. */
color_init();
/* If there are multiline coloring regexes, and there is no
* multiline cache data yet, precalculate it now. */
if (openfile->syntax && openfile->syntax->nmultis > 0 &&
openfile->fileage->multidata == NULL)
precalc_multicolorinfo();
#endif
/* Update the edit window. */

View File

@ -2799,12 +2799,6 @@ int main(int argc, char **argv)
fprintf(stderr, "Main: top and bottom win\n");
#endif
#ifndef DISABLE_COLOR
if (openfile->syntax)
if (openfile->syntax->nmultis > 0)
precalc_multicolorinfo();
#endif
/* If a starting position was given on the command line, go there. */
if (startline > 0 || startcol > 0)
do_gotolinecolumn(startline, startcol, FALSE, FALSE, FALSE, FALSE);

View File

@ -506,6 +506,7 @@ int do_input(bool allow_funcs);
int do_mouse(void);
#endif
void do_output(char *output, size_t output_len, bool allow_cntrls);
void precalc_multicolorinfo(void);
/* All functions in prompt.c. */
int do_statusbar_input(bool *ran_func, bool *finished,