Mercurial > vim
changeset 29218:48b36959a4fc v8.2.5128
patch 8.2.5128: syntax disabled when using synID() in searchpair() skip expr
Commit: https://github.com/vim/vim/commit/6f0cf62df97ee7c9d26b550adaf469be7fe1e09a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 19 12:27:45 2022 +0100
patch 8.2.5128: syntax disabled when using synID() in searchpair() skip expr
Problem: Syntax highlighting disabled when using synID() in searchpair()
skip expression and it times out. (Jaehwang Jung)
Solution: Add the redrawtime_limit_set flag. (closes #10562)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 19 Jun 2022 13:30:03 +0200 |
parents | 4a41a07b9a4b |
children | aad416d6fb3f |
files | src/drawscreen.c src/globals.h src/syntax.c src/version.c |
diffstat | 4 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -2179,6 +2179,7 @@ win_update(win_T *wp) #endif #ifdef SYN_TIME_LIMIT // Set the time limit to 'redrawtime'. + redrawtime_limit_set = TRUE; init_regexp_timeout(p_rdt); #endif #ifdef FEAT_FOLDING @@ -2692,6 +2693,7 @@ win_update(win_T *wp) #ifdef SYN_TIME_LIMIT disable_regexp_timeout(); + redrawtime_limit_set = FALSE; #endif // Reset the type of redrawing required, the window has been updated.
--- a/src/globals.h +++ b/src/globals.h @@ -1228,6 +1228,10 @@ EXTERN int do_redraw INIT(= FALSE); / #ifdef FEAT_DIFF EXTERN int need_diff_redraw INIT(= 0); // need to call diff_redraw() #endif +#ifdef FEAT_RELTIME +// flag set when 'redrawtime' timeout has been set +EXTERN int redrawtime_limit_set INIT(= FALSE); +#endif EXTERN int need_highlight_changed INIT(= TRUE);
--- a/src/syntax.c +++ b/src/syntax.c @@ -3150,8 +3150,8 @@ syn_regexec( colnr_T col, syn_time_T *st UNUSED) { - int r; - int timed_out = FALSE; + int r; + int timed_out = FALSE; #ifdef FEAT_PROFILE proftime_T pt; @@ -3181,7 +3181,7 @@ syn_regexec( } #endif #ifdef FEAT_RELTIME - if (timed_out && !syn_win->w_s->b_syn_slow) + if (timed_out && redrawtime_limit_set && !syn_win->w_s->b_syn_slow) { syn_win->w_s->b_syn_slow = TRUE; msg(_("'redrawtime' exceeded, syntax highlighting disabled"));