blob: 04c934f2c5d9edf6df849c22a69479e1b30bec2a [file] [log] [blame]
Bram Moolenaar8050efa2013-11-08 04:30:20 +01001Test for v:hlsearch vim: set ft=vim :
2
3STARTTEST
4:" Last abc: Q
5:so small.vim
6:new
7:call setline(1, repeat(['aaa'], 10))
8:set hlsearch nolazyredraw
9:let r=[]
10:command -nargs=0 -bar AddR :call add(r, [screenattr(1, 1), v:hlsearch])
11/aaa
12:AddR
13:nohlsearch
14:AddR
15:let v:hlsearch=1
16:AddR
17:let v:hlsearch=0
18:AddR
19:set hlsearch
20:AddR
21:let v:hlsearch=0
22:AddR
23n:AddR
24:let v:hlsearch=0
25:AddR
26/
27:AddR
28:let r1=r[0][0]
29:" I guess it is not guaranteed that screenattr outputs always the same character
30:call map(r, 'v:val[1].":".(v:val[0]==r1?"highlighted":"not highlighted")')
31:try
32: let v:hlsearch=[]
33:catch
34: call add(r, matchstr(v:exception,'^Vim(let):E\d\+:'))
35:endtry
36:bwipeout!
37:$put=r
38:call garbagecollect(1)
39:"
40:/^start:/,$wq! test.out
41:" vim: et ts=4 isk-=\:
42:call getchar()
43ENDTEST
44
45start: