annotate src/testdir/test_cpoptions.vim @ 31182:645c854bbf74 v9.0.0925

patch 9.0.0925: two conditions are always false Commit: https://github.com/vim/vim/commit/df3c0eb41e1f48596c85af88b42fed22e3cca328 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Nov 23 11:23:17 2022 +0000 patch 9.0.0925: two conditions are always false Problem: Two conditions are always false. Solution: Remove the conditions. Update return value types to make clear what could be returned. (closes #11593)
author Bram Moolenaar <Bram@vim.org>
date Wed, 23 Nov 2022 12:30:04 +0100
parents 4edfa418f8ba
children 3f39349c5107
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
1 " Test for the various 'cpoptions' (cpo) flags
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 source check.vim
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
4 source shared.vim
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 source view_util.vim
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 " Test for the 'a' flag in 'cpo'. Reading a file should set the alternate
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 " file name.
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 func Test_cpo_a()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 let save_cpo = &cpo
30164
f7a2de8a4ddc patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents: 29997
diff changeset
11 call writefile(['one'], 'XfileCpoA', 'D')
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 " Wipe out all the buffers, so that the alternate file is empty
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 edit Xfoo | %bw
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 set cpo-=a
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 new
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
16 read XfileCpoA
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 call assert_equal('', @#)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 %d
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 set cpo+=a
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
20 read XfileCpoA
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
21 call assert_equal('XfileCpoA', @#)
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 " Test for the 'A' flag in 'cpo'. Writing a file should set the alternate
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 " file name.
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 func Test_cpo_A()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 " Wipe out all the buffers, so that the alternate file is empty
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 edit Xfoo | %bw
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 set cpo-=A
29997
98f5a0618a77 patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents: 29924
diff changeset
33 new XcpoAfile1
98f5a0618a77 patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents: 29924
diff changeset
34 write XcpoAfile2
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 call assert_equal('', @#)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 %bw
29997
98f5a0618a77 patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents: 29924
diff changeset
37 call delete('XcpoAfile2')
98f5a0618a77 patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents: 29924
diff changeset
38 new XcpoAfile1
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 set cpo+=A
29997
98f5a0618a77 patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents: 29924
diff changeset
40 write XcpoAfile2
98f5a0618a77 patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents: 29924
diff changeset
41 call assert_equal('XcpoAfile2', @#)
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 close!
29997
98f5a0618a77 patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents: 29924
diff changeset
43 call delete('XcpoAfile2')
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 " Test for the 'b' flag in 'cpo'. "\|" at the end of a map command is
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 " recognized as the end of the map.
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 func Test_cpo_b()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 set cpo+=b
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 nnoremap <F5> :pwd\<CR>\|let i = 1
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 call assert_equal(':pwd\<CR>\', maparg('<F5>'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 nunmap <F5>
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 exe "nnoremap <F5> :pwd\<C-V>|let i = 1"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 call assert_equal(':pwd|let i = 1', maparg('<F5>'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 nunmap <F5>
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 set cpo-=b
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 nnoremap <F5> :pwd\<CR>\|let i = 1
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 call assert_equal(':pwd\<CR>|let i = 1', maparg('<F5>'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 nunmap <F5>
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
65 " Test for the 'B' flag in 'cpo'. A backslash in mappings, abbreviations, user
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
66 " commands and menu commands has no special meaning.
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
67 func Test_cpo_B()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
68 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
69 new
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
70 set cpo-=B
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
71 iabbr <buffer> abc ab\<BS>d
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
72 exe "normal iabc "
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
73 call assert_equal('ab<BS>d ', getline(1))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
74 %d
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
75 set cpo+=B
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
76 iabbr <buffer> abc ab\<BS>d
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
77 exe "normal iabc "
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
78 call assert_equal('abd ', getline(1))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
79 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
80 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
81 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
82
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 " Test for the 'c' flag in 'cpo'.
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 func Test_cpo_c()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 set cpo+=c
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 call setline(1, ' abababababab')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 exe "normal gg/abab\<CR>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 call assert_equal(3, searchcount().total)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 set cpo-=c
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 exe "normal gg/abab\<CR>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 call assert_equal(5, searchcount().total)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 " Test for the 'C' flag in 'cpo' (line continuation)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 func Test_cpo_C()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 let save_cpo = &cpo
30164
f7a2de8a4ddc patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents: 29997
diff changeset
101 call writefile(['let l = [', '\ 1,', '\ 2]'], 'XfileCpoC', 'D')
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 set cpo-=C
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
103 source XfileCpoC
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 call assert_equal([1, 2], g:l)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 set cpo+=C
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
106 call assert_fails('source XfileCpoC', ['E697:', 'E10:'])
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 " Test for the 'd' flag in 'cpo' (tags relative to the current file)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 func Test_cpo_d()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 let save_cpo = &cpo
30164
f7a2de8a4ddc patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents: 29997
diff changeset
113 call mkdir('XdirCpoD', 'R')
f7a2de8a4ddc patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents: 29997
diff changeset
114 call writefile(["one\tXfile1\t/^one$/"], 'tags', 'D')
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
115 call writefile(["two\tXfile2\t/^two$/"], 'XdirCpoD/tags')
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 set tags=./tags
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 set cpo-=d
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
118 edit XdirCpoD/Xfile
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 call assert_equal('two', taglist('.*')[0].name)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120 set cpo+=d
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 call assert_equal('one', taglist('.*')[0].name)
30164
f7a2de8a4ddc patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents: 29997
diff changeset
122
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 %bw!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 set tags&
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
128 " Test for the 'D' flag in 'cpo' (digraph after a r, f or t)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 func Test_cpo_D()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
130 CheckFeature digraphs
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
132 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
133 set cpo-=D
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
134 call setline(1, 'abcdefgh|')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
135 exe "norm! 1gg0f\<c-k>!!"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
136 call assert_equal(9, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 set cpo+=D
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138 exe "norm! 1gg0f\<c-k>!!"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 call assert_equal(1, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140 set cpo-=D
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
141 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 " Test for the 'e' flag in 'cpo'
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146 func Test_cpo_e()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148 let @a='let i = 45'
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149 set cpo+=e
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150 call feedkeys(":@a\<CR>", 'xt')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151 call assert_equal(45, i)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
152 set cpo-=e
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
153 call feedkeys(":@a\<CR>6\<CR>", 'xt')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
154 call assert_equal(456, i)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
155 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
156 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
157
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
158 " Test for the 'E' flag in 'cpo' with yank, change, delete, etc. operators
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
159 func Test_cpo_E()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
160 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
161 call setline(1, '')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
162 set cpo+=E
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
163 " yank an empty line
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
164 call assert_beeps('normal "ayl')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
165 " change an empty line
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
166 call assert_beeps('normal lcTa')
24725
3cdbce5ba73f patch 8.2.2901: some operators not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
167 call assert_beeps('normal 0c0')
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
168 " delete an empty line
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
169 call assert_beeps('normal D')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
170 call assert_beeps('normal dl')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
171 call assert_equal('', getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
172 " change case of an empty line
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
173 call assert_beeps('normal gul')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
174 call assert_beeps('normal gUl')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
175 " replace a character
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
176 call assert_beeps('normal vrx')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
177 " increment and decrement
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
178 call assert_beeps('exe "normal v\<C-A>"')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
179 call assert_beeps('exe "normal v\<C-X>"')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
180 set cpo-=E
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
181 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
182 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
183
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
184 " Test for the 'f' flag in 'cpo' (read in an empty buffer sets the file name)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
185 func Test_cpo_f()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
186 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
187 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
188 set cpo-=f
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
189 read test_cpoptions.vim
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
190 call assert_equal('', @%)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
191 %d
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
192 set cpo+=f
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
193 read test_cpoptions.vim
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
194 call assert_equal('test_cpoptions.vim', @%)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
195 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
196 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
197 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
198
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
199 " Test for the 'F' flag in 'cpo' (write in an empty buffer sets the file name)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
200 func Test_cpo_F()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
201 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
202 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
203 set cpo-=F
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
204 write XfileCpoF
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
205 call assert_equal('', @%)
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
206 call delete('XfileCpoF')
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
207 set cpo+=F
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
208 write XfileCpoF
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
209 call assert_equal('XfileCpoF', @%)
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
210 close!
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
211 call delete('XfileCpoF')
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
212 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
213 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
214
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
215 " Test for the 'g' flag in 'cpo' (jump to line 1 when re-editing a file)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
216 func Test_cpo_g()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
217 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
218 new test_cpoptions.vim
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
219 set cpo-=g
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
220 normal 20G
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
221 edit
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
222 call assert_equal(20, line('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
223 set cpo+=g
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
224 edit
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
225 call assert_equal(1, line('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
226 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
227 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
228 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
229
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
230 " Test for inserting text in a line with only spaces ('H' flag in 'cpoptions')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
231 func Test_cpo_H()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
232 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
233 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
234 set cpo-=H
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
235 call setline(1, ' ')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
236 normal! Ia
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
237 call assert_equal(' a', getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
238 set cpo+=H
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
239 call setline(1, ' ')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
240 normal! Ia
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
241 call assert_equal(' a ', getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
242 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
243 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
244 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
245
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
246 " TODO: Add a test for the 'i' flag in 'cpo'
20941
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
247 " Interrupting the reading of a file will leave it modified.
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
248
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
249 " Test for the 'I' flag in 'cpo' (deleting autoindent when using arrow keys)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
250 func Test_cpo_I()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
251 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
252 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
253 setlocal autoindent
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
254 set cpo+=I
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
255 exe "normal i one\<CR>\<Up>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
256 call assert_equal(' ', getline(2))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
257 set cpo-=I
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
258 %d
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
259 exe "normal i one\<CR>\<Up>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
260 call assert_equal('', getline(2))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
261 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
262 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
263 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
264
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
265 " Test for the 'j' flag in 'cpo' is in the test_join.vim file.
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
266
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
267 " Test for the 'J' flag in 'cpo' (two spaces after a sentence)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
268 func Test_cpo_J()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
269 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
270 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
271 set cpo-=J
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
272 call setline(1, 'one. two! three? four."'' five.)]')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
273 normal 0
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
274 for colnr in [6, 12, 19, 28, 34]
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
275 normal )
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
276 call assert_equal(colnr, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
277 endfor
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
278 for colnr in [28, 19, 12, 6, 1]
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
279 normal (
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
280 call assert_equal(colnr, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
281 endfor
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
282 set cpo+=J
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
283 normal 0
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
284 for colnr in [12, 28, 34]
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
285 normal )
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
286 call assert_equal(colnr, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
287 endfor
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
288 for colnr in [28, 12, 1]
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
289 normal (
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
290 call assert_equal(colnr, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
291 endfor
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
292 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
293 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
294 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
295
20941
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
296 " TODO: Add a test for the 'k' flag in 'cpo'.
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
297 " Disable the recognition of raw key codes in mappings, abbreviations, and the
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
298 " "to" part of menu commands.
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
299
20941
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
300 " TODO: Add a test for the 'K' flag in 'cpo'.
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
301 " Don't wait for a key code to complete when it is halfway a mapping.
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
302
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
303 " Test for the 'l' flag in 'cpo' (backslash in a [] range)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
304 func Test_cpo_l()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
305 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
306 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
307 call setline(1, ['', "a\tc" .. '\t'])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
308 set cpo-=l
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
309 exe 'normal gg/[\t]' .. "\<CR>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
310 call assert_equal([2, 8], [col('.'), virtcol('.')])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
311 set cpo+=l
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
312 exe 'normal gg/[\t]' .. "\<CR>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
313 call assert_equal([4, 10], [col('.'), virtcol('.')])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
314 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
315 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
316 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
317
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
318 " Test for inserting tab in virtual replace mode ('L' flag in 'cpoptions')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
319 func Test_cpo_L()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
320 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
321 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
322 set cpo-=L
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
323 call setline(1, 'abcdefghijklmnopqr')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
324 exe "normal 0gR\<Tab>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
325 call assert_equal("\<Tab>ijklmnopqr", getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
326 set cpo+=L
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
327 set list
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
328 call setline(1, 'abcdefghijklmnopqr')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
329 exe "normal 0gR\<Tab>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
330 call assert_equal("\<Tab>cdefghijklmnopqr", getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
331 set nolist
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
332 call setline(1, 'abcdefghijklmnopqr')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
333 exe "normal 0gR\<Tab>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
334 call assert_equal("\<Tab>ijklmnopqr", getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
335 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
336 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
337 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
338
20941
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
339 " TODO: Add a test for the 'm' flag in 'cpo'.
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
340 " When included, a showmatch will always wait half a second. When not
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
341 " included, a showmatch will wait half a second or until a character is typed.
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
342
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
343 " Test for the 'M' flag in 'cpo' (% with escape parenthesis)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
344 func Test_cpo_M()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
345 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
346 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
347 call setline(1, ['( \( )', '\( ( \)'])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
348
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
349 set cpo-=M
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
350 call cursor(1, 1)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
351 normal %
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
352 call assert_equal(6, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
353 call cursor(1, 4)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
354 call assert_beeps('normal %')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
355 call cursor(2, 2)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
356 normal %
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
357 call assert_equal(7, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
358 call cursor(2, 4)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
359 call assert_beeps('normal %')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
360
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
361 set cpo+=M
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
362 call cursor(1, 4)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
363 normal %
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
364 call assert_equal(6, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
365 call cursor(1, 1)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
366 call assert_beeps('normal %')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
367 call cursor(2, 4)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
368 normal %
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
369 call assert_equal(7, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
370 call cursor(2, 1)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
371 call assert_beeps('normal %')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
372
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
373 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
374 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
375 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
376
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
377 " Test for the 'n' flag in 'cpo' (using number column for wrapped lines)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
378 func Test_cpo_n()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
379 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
380 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
381 call setline(1, repeat('a', &columns))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
382 setlocal number
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
383 set cpo-=n
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
384 redraw!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
385 call assert_equal(' aaaa', Screenline(2))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
386 set cpo+=n
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
387 redraw!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
388 call assert_equal('aaaa', Screenline(2))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
389 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
390 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
391 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
392
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
393 " Test for the 'o' flag in 'cpo' (line offset to search command)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
394 func Test_cpo_o()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
395 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
396 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
397 call setline(1, ['', 'one', 'two', 'three', 'one', 'two', 'three'])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
398 set cpo-=o
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
399 exe "normal /one/+2\<CR>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
400 normal n
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
401 call assert_equal(7, line('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
402 set cpo+=o
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
403 exe "normal /one/+2\<CR>"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
404 normal n
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
405 call assert_equal(5, line('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
406 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
407 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
408 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
409
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
410 " Test for the 'O' flag in 'cpo' (overwriting an existing file)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
411 func Test_cpo_O()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
412 let save_cpo = &cpo
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
413 new XfileCpoO
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
414 call setline(1, 'one')
30164
f7a2de8a4ddc patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents: 29997
diff changeset
415 call writefile(['two'], 'XfileCpoO', 'D')
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
416 set cpo-=O
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
417 call assert_fails('write', 'E13:')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
418 set cpo+=O
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
419 write
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
420 call assert_equal(['one'], readfile('XfileCpoO'))
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
421 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
422 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
423 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
424
30805
4edfa418f8ba patch 9.0.0737: Lisp word only recognized when a space follows
Bram Moolenaar <Bram@vim.org>
parents: 30164
diff changeset
425 " Test for the 'p' flag in 'cpo' is in the test_lispindent.vim file.
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
426
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
427 " Test for the 'P' flag in 'cpo' (appending to a file sets the current file
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
428 " name)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
429 func Test_cpo_P()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
430 let save_cpo = &cpo
30164
f7a2de8a4ddc patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents: 29997
diff changeset
431 call writefile([], 'XfileCpoP', 'D')
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
432 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
433 call setline(1, 'one')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
434 set cpo+=F
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
435 set cpo-=P
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
436 write >> XfileCpoP
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
437 call assert_equal('', @%)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
438 set cpo+=P
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
439 write >> XfileCpoP
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
440 call assert_equal('XfileCpoP', @%)
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
441 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
442 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
443 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
444
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
445 " Test for the 'q' flag in 'cpo' (joining multiple lines)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
446 func Test_cpo_q()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
447 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
448 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
449 call setline(1, ['one', 'two', 'three', 'four', 'five'])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
450 set cpo-=q
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
451 normal gg4J
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
452 call assert_equal(14, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
453 %d
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
454 call setline(1, ['one', 'two', 'three', 'four', 'five'])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
455 set cpo+=q
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
456 normal gg4J
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
457 call assert_equal(4, col('.'))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
458 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
459 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
460 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
461
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
462 " Test for the 'r' flag in 'cpo' (redo command with a search motion)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
463 func Test_cpo_r()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
464 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
465 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
466 call setline(1, repeat(['one two three four'], 2))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
467 set cpo-=r
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
468 exe "normal ggc/two\<CR>abc "
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
469 let @/ = 'three'
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
470 normal 2G.
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
471 call assert_equal('abc two three four', getline(2))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
472 %d
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
473 call setline(1, repeat(['one two three four'], 2))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
474 set cpo+=r
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
475 exe "normal ggc/two\<CR>abc "
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
476 let @/ = 'three'
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
477 normal 2G.
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
478 call assert_equal('abc three four', getline(2))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
479 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
480 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
481 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
482
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
483 " Test for the 'R' flag in 'cpo' (clear marks after a filter command)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
484 func Test_cpo_R()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
485 CheckUnix
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
486 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
487 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
488 call setline(1, ['three', 'one', 'two'])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
489 set cpo-=R
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
490 3mark r
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
491 %!sort
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
492 call assert_equal(3, line("'r"))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
493 %d
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
494 call setline(1, ['three', 'one', 'two'])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
495 set cpo+=R
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
496 3mark r
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
497 %!sort
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
498 call assert_equal(0, line("'r"))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
499 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
500 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
501 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
502
20941
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
503 " TODO: Add a test for the 's' flag in 'cpo'.
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
504 " Set buffer options when entering the buffer for the first time. If not
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
505 " present the options are set when the buffer is created.
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
506
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
507 " Test for the 'S' flag in 'cpo' (copying buffer options)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
508 func Test_cpo_S()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
509 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
510 new Xfile1
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
511 set noautoindent
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
512 new Xfile2
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
513 set cpo-=S
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
514 set autoindent
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
515 wincmd p
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
516 call assert_equal(0, &autoindent)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
517 wincmd p
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
518 call assert_equal(1, &autoindent)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
519 set cpo+=S
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
520 wincmd p
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
521 call assert_equal(1, &autoindent)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
522 set noautoindent
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
523 wincmd p
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
524 call assert_equal(0, &autoindent)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
525 wincmd t
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
526 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
527 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
528 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
529 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
530
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
531 " Test for the 't' flag in 'cpo' is in the test_tagjump.vim file.
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
532
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
533 " Test for the 'u' flag in 'cpo' (Vi-compatible undo)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
534 func Test_cpo_u()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
535 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
536 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
537 set cpo-=u
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
538 exe "normal iabc\<C-G>udef\<C-G>ughi"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
539 normal uu
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
540 call assert_equal('abc', getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
541 %d
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
542 set cpo+=u
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
543 exe "normal iabc\<C-G>udef\<C-G>ughi"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
544 normal uu
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
545 call assert_equal('abcdefghi', getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
546 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
547 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
548 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
549
20941
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
550 " TODO: Add a test for the 'v' flag in 'cpo'.
505d97ea54da patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 20848
diff changeset
551 " Backspaced characters remain visible on the screen in Insert mode.
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
552
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
553 " Test for the 'w' flag in 'cpo' ('cw' on a blank character changes only one
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
554 " character)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
555 func Test_cpo_w()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
556 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
557 new
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
558 set cpo+=w
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
559 call setline(1, 'here are some words')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
560 norm! 1gg0elcwZZZ
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
561 call assert_equal('hereZZZ are some words', getline('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
562 norm! 1gg2elcWYYY
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
563 call assert_equal('hereZZZ areYYY some words', getline('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
564 set cpo-=w
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
565 call setline(1, 'here are some words')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
566 norm! 1gg0elcwZZZ
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
567 call assert_equal('hereZZZare some words', getline('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
568 norm! 1gg2elcWYYY
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
569 call assert_equal('hereZZZare someYYYwords', getline('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
570 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
571 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
572 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
573
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
574 " Test for the 'W' flag in 'cpo' is in the test_writefile.vim file
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
575
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
576 " Test for the 'x' flag in 'cpo' (Esc on command-line executes command)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
577 func Test_cpo_x()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
578 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
579 set cpo-=x
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
580 let i = 1
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
581 call feedkeys(":let i=10\<Esc>", 'xt')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
582 call assert_equal(1, i)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
583 set cpo+=x
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
584 call feedkeys(":let i=10\<Esc>", 'xt')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
585 call assert_equal(10, i)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
586 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
587 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
588
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
589 " Test for the 'X' flag in 'cpo' ('R' with a count)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
590 func Test_cpo_X()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
591 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
592 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
593 call setline(1, 'aaaaaa')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
594 set cpo-=X
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
595 normal gg4Rx
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
596 call assert_equal('xxxxaa', getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
597 normal ggRy
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
598 normal 4.
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
599 call assert_equal('yyyyaa', getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
600 call setline(1, 'aaaaaa')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
601 set cpo+=X
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
602 normal gg4Rx
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
603 call assert_equal('xxxxaaaaa', getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
604 normal ggRy
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
605 normal 4.
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
606 call assert_equal('yyyyxxxaaaaa', getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
607 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
608 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
609 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
610
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
611 " Test for the 'y' flag in 'cpo' (repeating a yank command)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
612 func Test_cpo_y()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
613 let save_cpo = &cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
614 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
615 call setline(1, ['one', 'two'])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
616 set cpo-=y
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
617 normal ggyy
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
618 normal 2G.
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
619 call assert_equal("one\n", @")
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
620 %d
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
621 call setline(1, ['one', 'two'])
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
622 set cpo+=y
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
623 normal ggyy
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
624 normal 2G.
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
625 call assert_equal("two\n", @")
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
626 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
627 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
628 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
629
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
630 " Test for the 'Z' flag in 'cpo' (write! resets 'readonly')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
631 func Test_cpo_Z()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
632 let save_cpo = &cpo
30164
f7a2de8a4ddc patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents: 29997
diff changeset
633 call writefile([], 'XfileCpoZ', 'D')
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
634 new XfileCpoZ
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
635 setlocal readonly
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
636 set cpo-=Z
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
637 write!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
638 call assert_equal(0, &readonly)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
639 set cpo+=Z
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
640 setlocal readonly
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
641 write!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
642 call assert_equal(1, &readonly)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
643 close!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
644 let &cpo = save_cpo
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
645 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
646
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
647 " Test for the '!' flag in 'cpo' is in the test_normal.vim file
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
648
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
649 " Test for displaying dollar when changing text ('$' flag in 'cpoptions')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
650 func Test_cpo_dollar()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
651 new
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
652 let g:Line = ''
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
653 func SaveFirstLine()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
654 let g:Line = Screenline(1)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
655 return ''
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
656 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
657 inoremap <expr> <buffer> <F2> SaveFirstLine()
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
658 call test_override('redraw_flag', 1)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
659 set cpo+=$
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
660 call setline(1, 'one two three')
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
661 redraw!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
662 exe "normal c2w\<F2>vim"
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
663 call assert_equal('one tw$ three', g:Line)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
664 call assert_equal('vim three', getline(1))
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
665 set cpo-=$
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
666 call test_override('ALL', 0)
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
667 delfunc SaveFirstLine
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
668 %bw!
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
669 endfunc
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
670
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
671 " Test for the '%' flag in 'cpo' (parenthesis matching inside strings)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
672 func Test_cpo_percent()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
673 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
674 new
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
675 call setline(1, ' if (strcmp("ab)cd(", s))')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
676 set cpo-=%
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
677 normal 8|%
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
678 call assert_equal(28, col('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
679 normal 15|%
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
680 call assert_equal(27, col('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
681 normal 27|%
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
682 call assert_equal(15, col('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
683 call assert_beeps("normal 19|%")
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
684 call assert_beeps("normal 22|%")
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
685 set cpo+=%
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
686 normal 8|%
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
687 call assert_equal(28, col('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
688 normal 15|%
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
689 call assert_equal(19, col('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
690 normal 27|%
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
691 call assert_equal(22, col('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
692 normal 19|%
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
693 call assert_equal(15, col('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
694 normal 22|%
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
695 call assert_equal(27, col('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
696 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
697 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
698 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
699
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
700 " Test for cursor movement with '-' in 'cpoptions'
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
701 func Test_cpo_minus()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
702 new
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
703 call setline(1, ['foo', 'bar', 'baz'])
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
704 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
705 set cpo+=-
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
706 call assert_beeps('normal 10j')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
707 call assert_equal(1, line('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
708 normal G
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
709 call assert_beeps('normal 10k')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
710 call assert_equal(3, line('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
711 call assert_fails(10, 'E16:')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
712 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
713 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
714 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
715
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
716 " Test for the '+' flag in 'cpo' ('write file' command resets the 'modified'
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
717 " flag)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
718 func Test_cpo_plus()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
719 let save_cpo = &cpo
30164
f7a2de8a4ddc patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents: 29997
diff changeset
720 call writefile([], 'XfileCpoPlus', 'D')
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
721 new XfileCpoPlus
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
722 call setline(1, 'foo')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
723 write X1
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
724 call assert_equal(1, &modified)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
725 set cpo+=+
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
726 write X2
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
727 call assert_equal(0, &modified)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
728 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
729 call delete('X1')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
730 call delete('X2')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
731 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
732 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
733
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
734 " Test for the '*' flag in 'cpo' (':*' is same as ':@')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
735 func Test_cpo_star()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
736 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
737 let x = 0
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
738 new
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
739 set cpo-=*
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
740 let @a = 'let x += 1'
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
741 call assert_fails('*a', 'E20:')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
742 set cpo+=*
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
743 *a
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
744 call assert_equal(1, x)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
745 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
746 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
747 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
748
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
749 " Test for the '<' flag in 'cpo' is in the test_mapping.vim file
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
750
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
751 " Test for the '>' flag in 'cpo' (use a new line when appending to a register)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
752 func Test_cpo_gt()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
753 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
754 new
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
755 call setline(1, 'one two')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
756 set cpo-=>
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
757 let @r = ''
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
758 normal gg"Rye
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
759 normal "Rye
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
760 call assert_equal("oneone", @r)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
761 set cpo+=>
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
762 let @r = ''
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
763 normal gg"Rye
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
764 normal "Rye
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
765 call assert_equal("\none\none", @r)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
766 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
767 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
768 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
769
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
770 " Test for the ';' flag in 'cpo'
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
771 " Test for t,f,F,T movement commands and 'cpo-;' setting
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
772 func Test_cpo_semicolon()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
773 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
774 new
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
775 call append(0, ["aaa two three four", " zzz", "yyy ",
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
776 \ "bbb yee yoo four", "ccc two three four",
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
777 \ "ddd yee yoo four"])
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
778 set cpo-=;
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
779 1
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
780 normal! 0tt;D
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
781 2
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
782 normal! 0fz;D
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
783 3
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
784 normal! $Fy;D
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
785 4
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
786 normal! $Ty;D
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
787 set cpo+=;
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
788 5
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
789 normal! 0tt;;D
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
790 6
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
791 normal! $Ty;;D
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
792
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
793 call assert_equal('aaa two', getline(1))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
794 call assert_equal(' z', getline(2))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
795 call assert_equal('y', getline(3))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
796 call assert_equal('bbb y', getline(4))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
797 call assert_equal('ccc', getline(5))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
798 call assert_equal('ddd yee y', getline(6))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
799 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
800 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
801 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
802
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
803 " Test for the '#' flag in 'cpo' (count before 'D', 'o' and 'O' operators)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
804 func Test_cpo_hash()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
805 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
806 new
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
807 set cpo-=#
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
808 call setline(1, ['one', 'two', 'three'])
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
809 normal gg2D
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
810 call assert_equal(['three'], getline(1, '$'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
811 normal gg2ofour
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
812 call assert_equal(['three', 'four', 'four'], getline(1, '$'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
813 normal gg2Otwo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
814 call assert_equal(['two', 'two', 'three', 'four', 'four'], getline(1, '$'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
815 %d
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
816 set cpo+=#
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
817 call setline(1, ['one', 'two', 'three'])
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
818 normal gg2D
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
819 call assert_equal(['', 'two', 'three'], getline(1, '$'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
820 normal gg2oone
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
821 call assert_equal(['', 'one', 'two', 'three'], getline(1, '$'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
822 normal gg2Ozero
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
823 call assert_equal(['zero', '', 'one', 'two', 'three'], getline(1, '$'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
824 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
825 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
826 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
827
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
828 " Test for the '&' flag in 'cpo'. The swap file is kept when a buffer is still
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
829 " loaded and ':preserve' is used.
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
830 func Test_cpo_ampersand()
30164
f7a2de8a4ddc patch 9.0.0418: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents: 29997
diff changeset
831 call writefile(['one'], 'XfileCpoAmp', 'D')
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
832 let after =<< trim [CODE]
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
833 set cpo+=&
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
834 preserve
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
835 qall
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
836 [CODE]
29924
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
837 if RunVim([], after, 'XfileCpoAmp')
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
838 call assert_equal(1, filereadable('.XfileCpoAmp.swp'))
f3804bc56d33 patch 9.0.0300: 'cpoptions' tests are flaky
Bram Moolenaar <Bram@vim.org>
parents: 24725
diff changeset
839 call delete('.XfileCpoAmp.swp')
20848
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
840 endif
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
841 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
842
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
843 " Test for the '\' flag in 'cpo' (backslash in a [] range in a search pattern)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
844 func Test_cpo_backslash()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
845 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
846 new
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
847 call setline(1, ['', " \\-string"])
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
848 set cpo-=\
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
849 exe 'normal gg/[ \-]' .. "\<CR>n"
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
850 call assert_equal(3, col('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
851 set cpo+=\
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
852 exe 'normal gg/[ \-]' .. "\<CR>n"
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
853 call assert_equal(2, col('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
854 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
855 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
856 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
857
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
858 " Test for the '/' flag in 'cpo' is in the test_substitute.vim file
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
859
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
860 " Test for the '{' flag in 'cpo' (the "{" and "}" commands stop at a {
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
861 " character at the start of a line)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
862 func Test_cpo_brace()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
863 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
864 new
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
865 call setline(1, ['', '{', ' int i;', '}', ''])
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
866 set cpo-={
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
867 normal gg}
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
868 call assert_equal(5, line('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
869 normal G{
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
870 call assert_equal(1, line('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
871 set cpo+={
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
872 normal gg}
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
873 call assert_equal(2, line('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
874 normal G{
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
875 call assert_equal(2, line('.'))
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
876 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
877 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
878 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
879
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
880 " Test for the '.' flag in 'cpo' (:cd command fails if the current buffer is
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
881 " modified)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
882 func Test_cpo_dot()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
883 let save_cpo = &cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
884 new Xfoo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
885 call setline(1, 'foo')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
886 let save_dir = getcwd()
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
887 set cpo+=.
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
888
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
889 " :cd should fail when buffer is modified and 'cpo' contains dot.
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
890 call assert_fails('cd ..', 'E747:')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
891 call assert_equal(save_dir, getcwd())
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
892
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
893 " :cd with exclamation mark should succeed.
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
894 cd! ..
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
895 call assert_notequal(save_dir, getcwd())
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
896
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
897 " :cd should succeed when buffer has been written.
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
898 w!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
899 exe 'cd ' .. fnameescape(save_dir)
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
900 call assert_equal(save_dir, getcwd())
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
901
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
902 call delete('Xfoo')
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
903 set cpo&
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
904 close!
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
905 let &cpo = save_cpo
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
906 endfunc
d3fa0d29fa9a patch 8.2.0976: some 'cpoptions' not tested
Bram Moolenaar <Bram@vim.org>
parents: 20832
diff changeset
907
20832
045442aa392b patch 8.2.0968: no proper testing of the 'cpoptions' flags
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
908 " vim: shiftwidth=2 sts=2 expandtab