5458
|
1 Test for v:hlsearch vim: set ft=vim :
|
|
2
|
|
3 STARTTEST
|
|
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
|
|
23 n:AddR
|
|
24 :let v:hlsearch=0
|
|
25 :AddR
|
|
26 /
|
|
27 :AddR
|
6413
|
28 :set nohls
|
|
29 /
|
|
30 :AddR
|
5458
|
31 :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()
|
|
46 ENDTEST
|
|
47
|
|
48 start:
|