@@ -93,12 +93,8 @@ static int lastc_bytelen = 1; /* >1 for multi-byte char */
9393/* copy of spats[], for keeping the search patterns while executing autocmds */
9494static struct spat saved_spats [2 ];
9595# ifdef FEAT_SEARCH_EXTRA
96- /* copy of spats[RE_SEARCH], for keeping the search patterns while incremental
97- * searching */
98- static struct spat saved_last_search_spat ;
99- static int did_save_last_search_spat = 0 ;
100- static int saved_last_idx = 0 ;
101- static int saved_no_hlsearch = 0 ;
96+ static int saved_spats_last_idx = 0 ;
97+ static int saved_spats_no_hlsearch = 0 ;
10298# endif
10399
104100static char_u * mr_pattern = NULL ; /* pattern used by search_regcomp() */
@@ -310,8 +306,8 @@ save_search_patterns(void)
310306 if (spats [1 ].pat != NULL )
311307 saved_spats [1 ].pat = vim_strsave (spats [1 ].pat );
312308#ifdef FEAT_SEARCH_EXTRA
313- saved_last_idx = last_idx ;
314- saved_no_hlsearch = no_hlsearch ;
309+ saved_spats_last_idx = last_idx ;
310+ saved_spats_no_hlsearch = no_hlsearch ;
315311#endif
316312 }
317313}
@@ -329,8 +325,8 @@ restore_search_patterns(void)
329325 vim_free (spats [1 ].pat );
330326 spats [1 ] = saved_spats [1 ];
331327#ifdef FEAT_SEARCH_EXTRA
332- last_idx = saved_last_idx ;
333- set_no_hlsearch (saved_no_hlsearch );
328+ last_idx = saved_spats_last_idx ;
329+ set_no_hlsearch (saved_spats_no_hlsearch );
334330#endif
335331 }
336332}
@@ -354,6 +350,13 @@ free_search_patterns(void)
354350#endif
355351
356352#ifdef FEAT_SEARCH_EXTRA
353+ // copy of spats[RE_SEARCH], for keeping the search patterns while incremental
354+ // searching
355+ static struct spat saved_last_search_spat ;
356+ static int did_save_last_search_spat = 0 ;
357+ static int saved_last_idx = 0 ;
358+ static int saved_no_hlsearch = 0 ;
359+
357360/*
358361 * Save and restore the search pattern for incremental highlight search
359362 * feature.
@@ -575,7 +578,7 @@ set_last_search_pat(
575578 saved_spats [idx ].pat = NULL ;
576579 else
577580 saved_spats [idx ].pat = vim_strsave (spats [idx ].pat );
578- saved_last_idx = last_idx ;
581+ saved_spats_last_idx = last_idx ;
579582 }
580583# ifdef FEAT_SEARCH_EXTRA
581584 /* If 'hlsearch' set and search pat changed: need redraw. */
0 commit comments