{VV_NAME("mouse_col", VAR_NUMBER), 0},
{VV_NAME("operator", VAR_STRING), VV_RO},
{VV_NAME("searchforward", VAR_NUMBER), 0},
+ {VV_NAME("hlsearch", VAR_NUMBER), 0},
{VV_NAME("oldfiles", VAR_LIST), 0},
{VV_NAME("windowid", VAR_NUMBER), VV_RO},
};
hash_add(&compat_hashtab, p->vv_di.di_key);
}
set_vim_var_nr(VV_SEARCHFORWARD, 1L);
+ set_vim_var_nr(VV_HLSEARCH, 1L);
set_reg_var(0); /* default for v:register is not 0 but '"' */
#ifdef EBCDIC
v->di_tv.vval.v_number = get_tv_number(tv);
if (STRCMP(varname, "searchforward") == 0)
set_search_direction(v->di_tv.vval.v_number ? '/' : '?');
+#ifdef FEAT_SEARCH_EXTRA
+ else if (STRCMP(varname, "hlsearch") == 0)
+ {
+ no_hlsearch = !v->di_tv.vval.v_number;
+ redraw_all_later(SOME_VALID);
+ }
+#endif
}
return;
}
ex_nohlsearch(eap)
exarg_T *eap UNUSED;
{
- no_hlsearch = TRUE;
+ SET_NO_HLSEARCH(TRUE);
redraw_all_later(SOME_VALID);
}
/* when 'hlsearch' is set or reset: reset no_hlsearch */
else if ((int *)varp == &p_hls)
{
- no_hlsearch = FALSE;
+ SET_NO_HLSEARCH(FALSE);
}
#endif
{
/* don't free regprog in the match list, it's a copy */
vim_regfree(shl->rm.regprog);
- 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);
- no_hlsearch = FALSE;
+ SET_NO_HLSEARCH(FALSE);
#endif
}
}
spats[1] = saved_spats[1];
last_idx = saved_last_idx;
# ifdef FEAT_SEARCH_EXTRA
- no_hlsearch = saved_no_hlsearch;
+ SET_NO_HLSEARCH(saved_no_hlsearch);
# endif
}
}
if (no_hlsearch && !(options & SEARCH_KEEP))
{
redraw_all_later(SOME_VALID);
- no_hlsearch = FALSE;
+ SET_NO_HLSEARCH(FALSE);
}
#endif
spats[idx].off.off = off;
#ifdef FEAT_SEARCH_EXTRA
if (setlast)
- 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)
- 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!). */
test81.out test82.out test83.out test84.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test97.out test98.out \
- test99.out test100.out
+ test99.out test100.out test101.out
.SUFFIXES: .in .out
test98.out: test98.in
test99.out: test99.in
test100.out: test100.in
+test101.out: test101.in
test84.out test85.out test86.out test87.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test98.out test99.out \
- test100.out
+ test100.out test101.out
SCRIPTS32 = test50.out test70.out
test84.out test85.out test86.out test87.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test98.out test99.out \
- test100out
+ test100out test101.out
SCRIPTS32 = test50.out test70.out
test81.out test82.out test83.out test84.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test98.out test99.out \
- test100.out
+ test100.out test101.out
.SUFFIXES: .in .out
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
-# Last change: 2013 Nov 07
+# Last change: 2013 Nov 08
#
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
# Edit the lines in the Configuration section below to select.
test82.out test83.out test84.out test88.out test89.out \
test90.out test91.out test92.out test93.out test94.out \
test95.out test96.out test97.out test98.out test99.out \
- test100.out
+ test100.out test101.out
# Known problems:
# Test 30: a problem around mac format - unknown reason
test84.out test85.out test86.out test87.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test97.out test98.out \
- test99.out test100.out
+ test99.out test100.out test101.out
SCRIPTS_GUI = test16.out
--- /dev/null
+Test for v:hlsearch vim: set ft=vim :
+
+STARTTEST
+:" Last abc: Q
+:so small.vim
+:new
+:call setline(1, repeat(['aaa'], 10))
+:set hlsearch nolazyredraw
+:let r=[]
+:command -nargs=0 -bar AddR :call add(r, [screenattr(1, 1), v:hlsearch])
+/aaa
+:AddR
+:nohlsearch
+:AddR
+:let v:hlsearch=1
+:AddR
+:let v:hlsearch=0
+:AddR
+:set hlsearch
+:AddR
+:let v:hlsearch=0
+:AddR
+n:AddR
+:let v:hlsearch=0
+:AddR
+/
+:AddR
+:let r1=r[0][0]
+:" I guess it is not guaranteed that screenattr outputs always the same character
+:call map(r, 'v:val[1].":".(v:val[0]==r1?"highlighted":"not highlighted")')
+:try
+: let v:hlsearch=[]
+:catch
+: call add(r, matchstr(v:exception,'^Vim(let):E\d\+:'))
+:endtry
+:bwipeout!
+:$put=r
+:call garbagecollect(1)
+:"
+:/^start:/,$wq! test.out
+:" vim: et ts=4 isk-=\:
+:call getchar()
+ENDTEST
+
+start:
--- /dev/null
+start:
+1:highlighted
+0:not highlighted
+1:highlighted
+0:not highlighted
+1:highlighted
+0:not highlighted
+1:highlighted
+0:not highlighted
+1:highlighted
+Vim(let):E706:
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 79,
/**/
78,
/**/
#define VV_MOUSE_COL 51
#define VV_OP 52
#define VV_SEARCHFORWARD 53
-#define VV_OLDFILES 54
-#define VV_WINDOWID 55
-#define VV_LEN 56 /* number of v: vars */
+#define VV_HLSEARCH 54
+#define VV_OLDFILES 55
+#define VV_WINDOWID 56
+#define VV_LEN 57 /* number of v: vars */
#ifdef FEAT_CLIPBOARD
/* 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)
+#else
+# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag)
+#endif
+
#endif /* VIM__H */