]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.5128: syntax disabled when using synID() in searchpair() skip expr v8.2.5128
authorBram Moolenaar <Bram@vim.org>
Sun, 19 Jun 2022 11:27:45 +0000 (12:27 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 19 Jun 2022 11:27:45 +0000 (12:27 +0100)
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)

src/drawscreen.c
src/globals.h
src/syntax.c
src/version.c

index 2c184bde0f79106418fb348559a4b469858e4952..4fea562fcf368eb03499f6a5acce2387fe0a8dd8 100644 (file)
@@ -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.
index 63377af5b11d33e68c2d060eb83f627478ce0650..888f6e95ddab2425305451a7e1eb286b7f839c60 100644 (file)
@@ -1228,6 +1228,10 @@ EXTERN int       do_redraw INIT(= FALSE);    // extra redraw once
 #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);
 
index 679b99d534772d4e278f33c2cd2e37f9c63b0ef1..c2e83e6904e724d74de626e38ea8205f9e18e8e8 100644 (file)
@@ -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"));
index 39bbd4d1398af944ff4a8149137db56a720e9e13..75cbbaf2e9cabe0d2bcab5d74ae6782bb9bb567a 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    5128,
 /**/
     5127,
 /**/