From: Benno Schulenberg Date: Sun, 3 Jan 2016 16:21:04 +0000 (+0000) Subject: Letting reset_multis() figure out whether after an addition a full refresh is X-Git-Tag: v2.5.1~20 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=37712fb1206c80b1fc9dc69c28537108bb8e1fd7;p=nano.git Letting reset_multis() figure out whether after an addition a full refresh is needed (for the sake of multiline regexes), instead of doing it always. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5524 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index abc65fea..bd995521 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * src/text.c (do_deletion), src/nano.c (do_input): Let reset_multis() figure out whether after a deletion a full refresh is needed, before doing a redraw of the current line. This fixes Savannah bug #46794. + * src/nano.c (do_output): Let reset_multis() figure out whether after + an addition a full refresh is needed (for multiline-regexes' sake), + instead of doing it always. 2016-01-02 Benno Schulenberg * src/text.c (do_spell, do_formatter): Plug three tiny memory leaks. diff --git a/src/nano.c b/src/nano.c index e7af9b06..43903453 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1946,14 +1946,6 @@ void do_output(char *output, size_t output_len, bool allow_cntrls) #endif } -#ifndef DISABLE_COLOR - /* If syntax highlighting is turned on and there are multiline regexes, - * the edit window will need to be refreshed. */ - if (!ISSET(NO_COLOR_SYNTAX) && openfile->syntax && - openfile->syntax->nmultis > 0) - edit_refresh_needed = TRUE; -#endif - #ifndef NANO_TINY /* Well, we might also need a full refresh if we've changed the * line length to be a new multiple of COLS. */ @@ -1969,6 +1961,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls) #ifndef DISABLE_COLOR reset_multis(openfile->current, FALSE); #endif + if (edit_refresh_needed == TRUE) { edit_refresh(); edit_refresh_needed = FALSE;