blob: 31fc334393106ac86b9be29dbca66efe8fa74e6a [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
Bram Moolenaar76440e22014-11-27 19:14:49 +010028:set nohls
29/
30:AddR
Bram Moolenaar8050efa2013-11-08 04:30:20 +010031:let r1=r[0][0]
32:" I guess it is not guaranteed that screenattr outputs always the same character
33:call map(r, 'v:val[1].":".(v:val[0]==r1?"highlighted":"not highlighted")')
34:try
35: let v:hlsearch=[]
36:catch
37: call add(r, matchstr(v:exception,'^Vim(let):E\d\+:'))
38:endtry
39:bwipeout!
40:$put=r
41:call garbagecollect(1)
42:"
43:/^start:/,$wq! test.out
44:" vim: et ts=4 isk-=\:
45:call getchar()
46ENDTEST
47
48start: