Problem: SET_NO_HLSEARCH() used in a wrong way.
Solution: Make it a function. (suggested by Dominique Pelle,
closes #2850)
(void)do_set(eap->arg, flags);
}
-#ifdef FEAT_SEARCH_EXTRA
+#if defined(FEAT_SEARCH_EXTRA) || defined(PROTO)
+ void
+set_no_hlsearch(int flag)
+{
+ no_hlsearch = flag;
+# ifdef FEAT_EVAL
+ set_vim_var_nr(VV_HLSEARCH, !no_hlsearch && p_hls);
+# endif
+}
+
/*
* ":nohlsearch"
*/
static void
ex_nohlsearch(exarg_T *eap UNUSED)
{
- SET_NO_HLSEARCH(TRUE);
+ set_no_hlsearch(TRUE);
redraw_all_later(SOME_VALID);
}
if (ccline.cmdlen == 0)
{
i = 0;
- SET_NO_HLSEARCH(TRUE); /* turn off previous highlight */
+ set_no_hlsearch(TRUE); /* turn off previous highlight */
redraw_all_later(SOME_VALID);
}
else
/* Disable 'hlsearch' highlighting if the pattern matches
* everything. Avoids a flash when typing "foo\|". */
if (empty_pattern(ccline.cmdbuff))
- SET_NO_HLSEARCH(TRUE);
+ set_no_hlsearch(TRUE);
validate_cursor();
/* May redraw the status line to show the cursor position. */
/* when 'hlsearch' is set or reset: reset no_hlsearch */
else if ((int *)varp == &p_hls)
{
- SET_NO_HLSEARCH(FALSE);
+ set_no_hlsearch(FALSE);
}
#endif
char_u *get_behave_arg(expand_T *xp, int idx);
char_u *get_messages_arg(expand_T *xp, int idx);
char_u *get_mapclear_arg(expand_T *xp, int idx);
+void set_no_hlsearch(int flag);
int get_pressedreturn(void);
void set_pressedreturn(int val);
/* vim: set ft=c : */
{
/* don't free regprog in the match list, it's a copy */
vim_regfree(shl->rm.regprog);
- SET_NO_HLSEARCH(TRUE);
+ set_no_hlsearch(TRUE);
}
shl->rm.regprog = NULL;
shl->lnum = 0;
/* If 'hlsearch' set and search pat changed: need redraw. */
if (p_hls)
redraw_all_later(SOME_VALID);
- SET_NO_HLSEARCH(FALSE);
+ set_no_hlsearch(FALSE);
#endif
}
}
spats[1] = saved_spats[1];
#ifdef FEAT_SEARCH_EXTRA
last_idx = saved_last_idx;
- SET_NO_HLSEARCH(saved_no_hlsearch);
+ set_no_hlsearch(saved_no_hlsearch);
#endif
}
}
set_vv_searchforward();
# endif
last_idx = saved_last_idx;
- SET_NO_HLSEARCH(saved_no_hlsearch);
+ set_no_hlsearch(saved_no_hlsearch);
}
char_u *
if (no_hlsearch && !(options & SEARCH_KEEP))
{
redraw_all_later(SOME_VALID);
- SET_NO_HLSEARCH(FALSE);
+ set_no_hlsearch(FALSE);
}
#endif
spats[idx].off.off = off;
#ifdef FEAT_SEARCH_EXTRA
if (setlast)
- {
- SET_NO_HLSEARCH(!hlsearch_on);
- }
+ set_no_hlsearch(!hlsearch_on);
#endif
}
}
#ifdef FEAT_SEARCH_EXTRA
/* restore no_hlsearch when keeping the old search pattern */
if (search_options)
- {
- SET_NO_HLSEARCH(save_no_hlsearch);
- }
+ set_no_hlsearch(save_no_hlsearch);
#endif
/* Return OK if jumped to another file (at least we found the file!). */
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1768,
/**/
1767,
/**/
/* Character used as separated in autoload function/variable names. */
#define AUTOLOAD_CHAR '#'
-#ifdef FEAT_EVAL
-# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr(VV_HLSEARCH, !no_hlsearch && p_hls)
-#else
-# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag)
-#endif
-
#ifdef FEAT_JOB_CHANNEL
# define MAX_OPEN_CHANNELS 10
#else