5712
|
1 Tests for 'undolevel' and 'lispwords' settings being global-local
|
5450
|
2
|
|
3 STARTTEST
|
|
4 :so small.vim
|
|
5 :set nocompatible viminfo+=nviminfo ul=5
|
|
6 :fu! FillBuffer()
|
|
7 :for i in range(1,13)
|
|
8 :put=i
|
|
9 :exe "setg ul=" . &g:ul
|
|
10 :endfor
|
|
11 :endfu
|
|
12 :fu! UndoLevel()
|
|
13 :redir @a | setglobal undolevels? | echon ' global' | setlocal undolevels? | echon ' local' |redir end
|
|
14 :$put a
|
|
15 :endfu
|
|
16 :new one
|
|
17 :0put ='ONE: expecting global undolevels: 5, local undolevels: -123456 (default)'
|
|
18 :call FillBuffer()
|
6272
|
19 :earlier 10
|
5450
|
20 :call UndoLevel()
|
6136
|
21 :set ff=unix
|
5450
|
22 :%w! test.out
|
|
23 :new two
|
|
24 :0put ='TWO: expecting global undolevels: 5, local undolevels: 2 (first) then 10 (afterwards)'
|
|
25 :setlocal ul=2
|
|
26 :call FillBuffer()
|
6272
|
27 :earlier 10
|
5450
|
28 :call UndoLevel()
|
|
29 :setlocal ul=10
|
|
30 :call UndoLevel()
|
6136
|
31 :set ff=unix
|
5450
|
32 :%w >> test.out
|
|
33 :wincmd p
|
|
34 :redir >>test.out | echo "global value shouldn't be changed and still be 5!" | echo 'ONE: expecting global undolevels: 5, local undolevels: -123456 (default)'|:setglobal undolevels? | echon ' global' | setlocal undolevels? | echon ' local' |echo "" |redir end
|
|
35 :new three
|
|
36 :setglobal ul=50
|
|
37 :1put ='global value should be changed to 50'
|
|
38 :2put ='THREE: expecting global undolevels: 50, local undolevels: -123456 (default)'
|
|
39 :call UndoLevel()
|
6136
|
40 :set ff=unix
|
5450
|
41 :%w >> test.out
|
|
42 :"sleep 10
|
5712
|
43 :"
|
|
44 :" Testing 'lispwords'
|
|
45 :"
|
|
46 :setglobal lispwords=foo,bar,baz
|
|
47 :setlocal lispwords-=foo | setlocal lispwords+=quux
|
|
48 :redir >> test.out | echon "\nTesting 'lispwords' local value" | setglobal lispwords? | setlocal lispwords? | echo &lispwords . "\n" | redir end
|
|
49 :setlocal lispwords<
|
|
50 :redir >> test.out | echon "\nTesting 'lispwords' value reset" | setglobal lispwords? | setlocal lispwords? | echo &lispwords . "\n" | redir end
|
5450
|
51 :qa!
|
|
52 ENDTEST
|
|
53
|