annotate src/testdir/test_viminfo.vim @ 18469:66964658cc3c v8.1.2228

patch 8.1.2228: screenpos() returns wrong values when 'number' is set Commit: https://github.com/vim/vim/commit/38ba4dce4a8574e60f6ddb111922880b0c7affdc Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 27 21:39:09 2019 +0100 patch 8.1.2228: screenpos() returns wrong values when 'number' is set Problem: screenpos() returns wrong values when 'number' is set. (Ben Jackson) Solution: Compare the column with the window width. (closes #5133)
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Oct 2019 21:45:03 +0100
parents f6dcf7eabd26
children de2d1820215a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for reading and writing .viminfo
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
18263
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
3 source check.vim
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
4
10285
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
5 function Test_viminfo_read_and_write()
17466
15de78cb9f39 patch 8.1.1731: command line history not read from viminfo on startup
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
6 " First clear 'history', so that "hislen" is zero. Then set it again,
15de78cb9f39 patch 8.1.1731: command line history not read from viminfo on startup
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
7 " simulating Vim starting up.
15de78cb9f39 patch 8.1.1731: command line history not read from viminfo on startup
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
8 set history=0
15de78cb9f39 patch 8.1.1731: command line history not read from viminfo on startup
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
9 wviminfo Xviminfo
15de78cb9f39 patch 8.1.1731: command line history not read from viminfo on startup
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
10 set history=1000
15de78cb9f39 patch 8.1.1731: command line history not read from viminfo on startup
Bram Moolenaar <Bram@vim.org>
parents: 15607
diff changeset
11
9240
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
12 call histdel(':')
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 let lines = [
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 \ '# comment line',
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 \ '*encoding=utf-8',
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 \ '~MSle0~/asdf',
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 \ '|copied as-is',
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 \ '|and one more',
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 \ ]
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 call writefile(lines, 'Xviminfo')
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 rviminfo Xviminfo
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call assert_equal('asdf', @/)
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 wviminfo Xviminfo
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 let lines = readfile('Xviminfo')
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 let done = 0
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 for line in lines
10285
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
28 if line[0] == '|' && line !~ '^|[234],' && line !~ '^|<'
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 if done == 0
9284
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
30 call assert_equal('|1,4', line)
9240
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
31 elseif done == 1
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 call assert_equal('|copied as-is', line)
9240
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
33 elseif done == 2
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 call assert_equal('|and one more', line)
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 endif
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 let done += 1
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 endif
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 endfor
9240
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
39 call assert_equal(3, done)
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 call delete('Xviminfo')
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 endfunc
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 func Test_global_vars()
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
45 let g:MY_GLOBAL_STRING = "Vim Editor"
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
46 let g:MY_GLOBAL_NUM = 345
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
47 let g:MY_GLOBAL_FLOAT = 3.14
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 let test_dict = {'foo': 1, 'bar': 0, 'longvarible': 1000}
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 let g:MY_GLOBAL_DICT = test_dict
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 " store a really long list, so line wrapping will occur in viminfo file
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 let test_list = range(1,100)
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 let g:MY_GLOBAL_LIST = test_list
15466
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
53 let test_blob = 0z00112233445566778899aabbccddeeff
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
54 let g:MY_GLOBAL_BLOB = test_blob
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
55 let test_false = v:false
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
56 let g:MY_GLOBAL_FALSE = test_false
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
57 let test_true = v:true
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
58 let g:MY_GLOBAL_TRUE = test_true
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
59 let test_null = v:null
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
60 let g:MY_GLOBAL_NULL = test_null
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
61 let test_none = v:none
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
62 let g:MY_GLOBAL_NONE = test_none
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
63
8796
fb764adba294 commit https://github.com/vim/vim/commit/e9c07270031e312082604d3505650f185aa65948
Christian Brabandt <cb@256bit.org>
parents: 7664
diff changeset
64 set viminfo='100,<50,s10,h,!,nviminfo
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 wv! Xviminfo
15466
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
66
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
67 unlet g:MY_GLOBAL_STRING
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
68 unlet g:MY_GLOBAL_NUM
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
69 unlet g:MY_GLOBAL_FLOAT
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 unlet g:MY_GLOBAL_DICT
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 unlet g:MY_GLOBAL_LIST
15466
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
72 unlet g:MY_GLOBAL_BLOB
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
73 unlet g:MY_GLOBAL_FALSE
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
74 unlet g:MY_GLOBAL_TRUE
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
75 unlet g:MY_GLOBAL_NULL
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
76 unlet g:MY_GLOBAL_NONE
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 rv! Xviminfo
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
79 call assert_equal("Vim Editor", g:MY_GLOBAL_STRING)
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
80 call assert_equal(345, g:MY_GLOBAL_NUM)
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
81 call assert_equal(3.14, g:MY_GLOBAL_FLOAT)
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 call assert_equal(test_dict, g:MY_GLOBAL_DICT)
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 call assert_equal(test_list, g:MY_GLOBAL_LIST)
15466
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
84 call assert_equal(test_blob, g:MY_GLOBAL_BLOB)
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
85 call assert_equal(test_false, g:MY_GLOBAL_FALSE)
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
86 call assert_equal(test_true, g:MY_GLOBAL_TRUE)
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
87 call assert_equal(test_null, g:MY_GLOBAL_NULL)
435fcefd2c8e patch 8.1.0741: viminfo with Blob is not tested
Bram Moolenaar <Bram@vim.org>
parents: 11183
diff changeset
88 call assert_equal(test_none, g:MY_GLOBAL_NONE)
7664
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 call delete('Xviminfo')
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 set viminfo-=!
1fded31d9e04 commit https://github.com/vim/vim/commit/b20e334859334be35de4b295023a2b49bdabbfa9
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 endfunc
9240
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
93
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
94 func Test_cmdline_history()
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
95 call histdel(':')
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
96 call test_settime(11)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
97 call histadd(':', "echo 'one'")
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
98 call test_settime(12)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
99 " split into two lines
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
100 let long800 = repeat(" 'eight'", 100)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
101 call histadd(':', "echo " . long800)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
102 call test_settime(13)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
103 " split into three lines
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
104 let long1400 = repeat(" 'fourteeeeen'", 100)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
105 call histadd(':', "echo " . long1400)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
106 wviminfo Xviminfo
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
107 let lines = readfile('Xviminfo')
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
108 let done_colon = 0
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
109 let done_bar = 0
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
110 let lnum = 0
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
111 while lnum < len(lines)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
112 let line = lines[lnum] | let lnum += 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
113 if line[0] == ':'
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
114 if done_colon == 0
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
115 call assert_equal(":\x161408", line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
116 let line = lines[lnum] | let lnum += 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
117 call assert_equal('<echo ' . long1400, line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
118 elseif done_colon == 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
119 call assert_equal(":\x16808", line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
120 let line = lines[lnum] | let lnum += 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
121 call assert_equal("<echo " . long800, line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
122 elseif done_colon == 2
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
123 call assert_equal(":echo 'one'", line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
124 endif
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
125 let done_colon += 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
126 elseif line[0:4] == '|2,0,'
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
127 if done_bar == 0
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
128 call assert_equal("|2,0,13,,>1407", line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
129 let line = lines[lnum] | let lnum += 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
130 call assert_equal('|<"echo ' . long1400[0:484], line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
131 let line = lines[lnum] | let lnum += 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
132 call assert_equal('|<' . long1400[485:974], line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
133 let line = lines[lnum] | let lnum += 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
134 call assert_equal('|<' . long1400[975:] . '"', line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
135 elseif done_bar == 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
136 call assert_equal('|2,0,12,,>807', line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
137 let line = lines[lnum] | let lnum += 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
138 call assert_equal('|<"echo ' . long800[0:484], line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
139 let line = lines[lnum] | let lnum += 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
140 call assert_equal('|<' . long800[485:] . '"', line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
141 elseif done_bar == 2
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
142 call assert_equal("|2,0,11,,\"echo 'one'\"", line)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
143 endif
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
144 let done_bar += 1
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
145 endif
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
146 endwhile
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
147 call assert_equal(3, done_colon)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
148 call assert_equal(3, done_bar)
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
149
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
150 call histdel(':')
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
151 rviminfo Xviminfo
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
152 call assert_equal("echo " . long1400, histget(':', -1))
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
153 call assert_equal("echo " . long800, histget(':', -2))
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
154 call assert_equal("echo 'one'", histget(':', -3))
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
155
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
156 call delete('Xviminfo')
636cfa97200e commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Christian Brabandt <cb@256bit.org>
parents: 8796
diff changeset
157 endfunc
9256
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
158
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
159 func Test_cmdline_history_order()
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
160 call histdel(':')
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
161 call test_settime(11)
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
162 call histadd(':', "echo '11'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
163 call test_settime(22)
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
164 call histadd(':', "echo '22'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
165 call test_settime(33)
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
166 call histadd(':', "echo '33'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
167 wviminfo Xviminfo
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
168
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
169 call histdel(':')
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
170 " items go in between
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
171 call test_settime(15)
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
172 call histadd(':', "echo '15'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
173 call test_settime(27)
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
174 call histadd(':', "echo '27'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
175
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
176 rviminfo Xviminfo
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
177 call assert_equal("echo '33'", histget(':', -1))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
178 call assert_equal("echo '27'", histget(':', -2))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
179 call assert_equal("echo '22'", histget(':', -3))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
180 call assert_equal("echo '15'", histget(':', -4))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
181 call assert_equal("echo '11'", histget(':', -5))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
182
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
183 call histdel(':')
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
184 " items go before and after
18031
8a2fb21c23c0 patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17532
diff changeset
185 eval 8->test_settime()
9256
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
186 call histadd(':', "echo '8'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
187 call test_settime(39)
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
188 call histadd(':', "echo '39'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
189
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
190 rviminfo Xviminfo
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
191 call assert_equal("echo '39'", histget(':', -1))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
192 call assert_equal("echo '33'", histget(':', -2))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
193 call assert_equal("echo '22'", histget(':', -3))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
194 call assert_equal("echo '11'", histget(':', -4))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
195 call assert_equal("echo '8'", histget(':', -5))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
196
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
197 " Check sorting works when writing with merge.
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
198 call histdel(':')
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
199 call test_settime(8)
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
200 call histadd(':', "echo '8'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
201 call test_settime(15)
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
202 call histadd(':', "echo '15'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
203 call test_settime(27)
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
204 call histadd(':', "echo '27'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
205 call test_settime(39)
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
206 call histadd(':', "echo '39'")
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
207 wviminfo Xviminfo
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
208
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
209 call histdel(':')
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
210 rviminfo Xviminfo
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
211 call assert_equal("echo '39'", histget(':', -1))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
212 call assert_equal("echo '33'", histget(':', -2))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
213 call assert_equal("echo '27'", histget(':', -3))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
214 call assert_equal("echo '22'", histget(':', -4))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
215 call assert_equal("echo '15'", histget(':', -5))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
216 call assert_equal("echo '11'", histget(':', -6))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
217 call assert_equal("echo '8'", histget(':', -7))
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
218
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
219 call delete('Xviminfo')
26c7bf23ec1d commit https://github.com/vim/vim/commit/1fd99c1ca89a3d13bb53aff4a5a8f5ee740713e5
Christian Brabandt <cb@256bit.org>
parents: 9240
diff changeset
220 endfunc
9268
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
221
9274
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
222 func Test_viminfo_registers()
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
223 call test_settime(8)
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
224 call setreg('a', "eight", 'c')
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
225 call test_settime(20)
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
226 call setreg('b', ["twenty", "again"], 'l')
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
227 call test_settime(40)
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
228 call setreg('c', ["four", "agai"], 'b4')
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
229 let l = []
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
230 set viminfo='100,<600,s10,h,!,nviminfo
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
231 for i in range(500)
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
232 call add(l, 'something')
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
233 endfor
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
234 call setreg('d', l, 'l')
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
235 call setreg('e', "abc\<C-V>xyz")
9274
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
236 wviminfo Xviminfo
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
237
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
238 call test_settime(10)
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
239 call setreg('a', '', 'b10')
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
240 call test_settime(15)
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
241 call setreg('b', 'drop')
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
242 call test_settime(50)
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
243 call setreg('c', 'keep', 'l')
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
244 call test_settime(30)
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
245 call setreg('d', 'drop', 'l')
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
246 call setreg('e', 'drop')
9274
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
247 rviminfo Xviminfo
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
248
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
249 call assert_equal("", getreg('a'))
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
250 call assert_equal("\<C-V>10", getregtype('a'))
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
251 call assert_equal("twenty\nagain\n", getreg('b'))
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
252 call assert_equal("V", getregtype('b'))
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
253 call assert_equal("keep\n", getreg('c'))
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
254 call assert_equal("V", getregtype('c'))
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
255 call assert_equal(l, getreg('d', 1, 1))
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
256 call assert_equal("V", getregtype('d'))
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
257 call assert_equal("abc\<C-V>xyz", getreg('e'))
9274
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
258
9978
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
259 " Length around 440 switches to line continuation.
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
260 let len = 434
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
261 while len < 445
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
262 let s = repeat('a', len)
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
263 call setreg('"', s)
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
264 wviminfo Xviminfo
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
265 call setreg('"', '')
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
266 rviminfo Xviminfo
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
267 call assert_equal(s, getreg('"'), 'wrong register at length: ' . len)
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
268
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
269 let len += 1
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
270 endwhile
baad324e9fbc commit https://github.com/vim/vim/commit/257095760732597983bdd026e791907b7980e295
Christian Brabandt <cb@256bit.org>
parents: 9941
diff changeset
271
9274
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
272 call delete('Xviminfo')
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
273 endfunc
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
274
9284
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
275 func Test_viminfo_marks()
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
276 sp bufa
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
277 let bufa = bufnr('%')
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
278 sp bufb
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
279 let bufb = bufnr('%')
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
280
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
281 call test_settime(8)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
282 call setpos("'A", [bufa, 1, 1, 0])
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
283 call test_settime(20)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
284 call setpos("'B", [bufb, 9, 1, 0])
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
285 call setpos("'C", [bufa, 7, 1, 0])
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
286
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
287 delmark 0-9
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
288 call test_settime(25)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
289 call setpos("'1", [bufb, 12, 1, 0])
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
290 call test_settime(35)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
291 call setpos("'0", [bufa, 11, 1, 0])
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
292
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
293 call test_settime(45)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
294 wviminfo Xviminfo
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
295
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
296 " Writing viminfo inserts the '0 mark.
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
297 call assert_equal([bufb, 1, 1, 0], getpos("'0"))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
298 call assert_equal([bufa, 11, 1, 0], getpos("'1"))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
299 call assert_equal([bufb, 12, 1, 0], getpos("'2"))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
300
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
301 call test_settime(4)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
302 call setpos("'A", [bufa, 9, 1, 0])
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
303 call test_settime(30)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
304 call setpos("'B", [bufb, 2, 3, 0])
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
305 delmark C
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
306
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
307 delmark 0-9
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
308 call test_settime(30)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
309 call setpos("'1", [bufb, 22, 1, 0])
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
310 call test_settime(55)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
311 call setpos("'0", [bufa, 21, 1, 0])
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
312
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
313 rviminfo Xviminfo
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
314
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
315 call assert_equal([bufa, 1, 1, 0], getpos("'A"))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
316 call assert_equal([bufb, 2, 3, 0], getpos("'B"))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
317 call assert_equal([bufa, 7, 1, 0], getpos("'C"))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
318
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
319 " numbered marks are merged
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
320 call assert_equal([bufa, 21, 1, 0], getpos("'0")) " time 55
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
321 call assert_equal([bufb, 1, 1, 0], getpos("'1")) " time 45
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
322 call assert_equal([bufa, 11, 1, 0], getpos("'2")) " time 35
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
323 call assert_equal([bufb, 22, 1, 0], getpos("'3")) " time 30
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
324 call assert_equal([bufb, 12, 1, 0], getpos("'4")) " time 25
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
325
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
326 call delete('Xviminfo')
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
327 exe 'bwipe ' . bufa
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
328 exe 'bwipe ' . bufb
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
329 endfunc
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
330
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
331 func Test_viminfo_jumplist()
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
332 split testbuf
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
333 clearjumps
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
334 call setline(1, ['time 05', 'time 10', 'time 15', 'time 20', 'time 30', 'last pos'])
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
335 call cursor(2, 1)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
336 call test_settime(10)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
337 exe "normal /20\r"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
338 call test_settime(20)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
339 exe "normal /30\r"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
340 call test_settime(30)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
341 exe "normal /last pos\r"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
342 wviminfo Xviminfo
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
343
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
344 clearjumps
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
345 call cursor(1, 1)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
346 call test_settime(5)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
347 exe "normal /15\r"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
348 call test_settime(15)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
349 exe "normal /last pos\r"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
350 call test_settime(40)
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
351 exe "normal ?30\r"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
352 rviminfo Xviminfo
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
353
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
354 call assert_equal('time 30', getline('.'))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
355 exe "normal \<C-O>"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
356 call assert_equal('last pos', getline('.'))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
357 exe "normal \<C-O>"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
358 " duplicate for 'time 30' was removed
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
359 call assert_equal('time 20', getline('.'))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
360 exe "normal \<C-O>"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
361 call assert_equal('time 15', getline('.'))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
362 exe "normal \<C-O>"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
363 call assert_equal('time 10', getline('.'))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
364 exe "normal \<C-O>"
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
365 call assert_equal('time 05', getline('.'))
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
366
9299
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
367 clearjumps
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
368 call cursor(1, 1)
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
369 call test_settime(5)
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
370 exe "normal /15\r"
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
371 call test_settime(15)
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
372 exe "normal /last pos\r"
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
373 call test_settime(40)
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
374 exe "normal ?30\r"
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
375 " Test merge when writing
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
376 wviminfo Xviminfo
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
377 clearjumps
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
378 rviminfo Xviminfo
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
379
9313
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
380 let last_line = line('.')
9299
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
381 exe "normal \<C-O>"
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
382 call assert_equal('time 30', getline('.'))
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
383 exe "normal \<C-O>"
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
384 call assert_equal('last pos', getline('.'))
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
385 exe "normal \<C-O>"
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
386 " duplicate for 'time 30' was removed
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
387 call assert_equal('time 20', getline('.'))
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
388 exe "normal \<C-O>"
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
389 call assert_equal('time 15', getline('.'))
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
390 exe "normal \<C-O>"
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
391 call assert_equal('time 10', getline('.'))
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
392 exe "normal \<C-O>"
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
393 call assert_equal('time 05', getline('.'))
8000f0a44744 commit https://github.com/vim/vim/commit/ece74ab103eca15e17435efbe9cb21039787f1ea
Christian Brabandt <cb@256bit.org>
parents: 9284
diff changeset
394
9313
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
395 " Test with jumplist full.
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
396 clearjumps
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
397 call setline(1, repeat(['match here'], 101))
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
398 call cursor(1, 1)
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
399 call test_settime(10)
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
400 for i in range(100)
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
401 exe "normal /here\r"
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
402 endfor
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
403 rviminfo Xviminfo
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
404
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
405 " must be newest mark that comes from viminfo.
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
406 exe "normal \<C-O>"
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
407 call assert_equal(last_line, line('.'))
c0760b25f31d commit https://github.com/vim/vim/commit/28607ba2b82668503f8406bc13690d59af46deb3
Christian Brabandt <cb@256bit.org>
parents: 9299
diff changeset
408
9284
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
409 bwipe!
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
410 call delete('Xviminfo')
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
411 endfunc
78712a2f687a commit https://github.com/vim/vim/commit/2d35899721da0e9359a9fe1059554f8c4ea7f0c1
Christian Brabandt <cb@256bit.org>
parents: 9274
diff changeset
412
9268
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
413 func Test_viminfo_encoding()
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
414 set enc=latin1
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
415 call histdel(':')
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
416 call histadd(':', "echo '\xe9'")
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
417 wviminfo Xviminfo
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
418
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
419 set fencs=utf-8,latin1
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
420 set enc=utf-8
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
421 sp Xviminfo
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
422 call assert_equal('latin1', &fenc)
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
423 close
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
424
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
425 call histdel(':')
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
426 rviminfo Xviminfo
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
427 call assert_equal("echo 'é'", histget(':', -1))
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
428
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
429 call delete('Xviminfo')
a00e32b5bb39 commit https://github.com/vim/vim/commit/012270936c3c7df3bba45ad2b48938c23a2fd43a
Christian Brabandt <cb@256bit.org>
parents: 9256
diff changeset
430 endfunc
9270
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
431
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
432 func Test_viminfo_bad_syntax()
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
433 let lines = []
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
434 call add(lines, '|<') " empty continuation line
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
435 call add(lines, '|234234234234234324,nothing')
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
436 call add(lines, '|1+"no comma"')
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
437 call add(lines, '|1,2,3,4,5,6,7') " too many items
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
438 call add(lines, '|1,"string version"')
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
439 call add(lines, '|1,>x') " bad continuation line
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
440 call add(lines, '|1,"x') " missing quote
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
441 call add(lines, '|1,"x\') " trailing backslash
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
442 call add(lines, '|1,,,,') "trailing comma
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
443 call add(lines, '|1,>234') " trailing continuation line
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
444 call writefile(lines, 'Xviminfo')
9274
083113d751ff commit https://github.com/vim/vim/commit/e80ff7448d886805b459250b090aaa20d96e8c2b
Christian Brabandt <cb@256bit.org>
parents: 9270
diff changeset
445 rviminfo Xviminfo
9270
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
446
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
447 call delete('Xviminfo')
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
448 endfunc
79cb08f0d812 commit https://github.com/vim/vim/commit/62f8b4e18014b259bcde4a2845c602b0a44a3714
Christian Brabandt <cb@256bit.org>
parents: 9268
diff changeset
449
9414
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
450 func Test_viminfo_file_marks()
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
451 silent! bwipe test_viminfo.vim
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
452 silent! bwipe Xviminfo
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
453
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
454 call test_settime(10)
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
455 edit ten
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
456 call test_settime(25)
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
457 edit again
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
458 call test_settime(30)
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
459 edit thirty
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
460 wviminfo Xviminfo
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
461
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
462 call test_settime(20)
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
463 edit twenty
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
464 call test_settime(35)
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
465 edit again
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
466 call test_settime(40)
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
467 edit fourty
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
468 wviminfo Xviminfo
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
469
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
470 sp Xviminfo
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
471 1
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
472 for name in ['fourty', 'again', 'thirty', 'twenty', 'ten']
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
473 /^>
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
474 call assert_equal(name, substitute(getline('.'), '.*/', '', ''))
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
475 endfor
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
476 close
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
477
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
478 call delete('Xviminfo')
1003973c99df commit https://github.com/vim/vim/commit/ab9c89b68dcbdb3fbda8c5a50dd90caca64f1bfd
Christian Brabandt <cb@256bit.org>
parents: 9313
diff changeset
479 endfunc
9875
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
480
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
481 func Test_viminfo_file_mark_tabclose()
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
482 tabnew Xtestfileintab
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
483 call setline(1, ['a','b','c','d','e'])
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
484 4
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
485 q!
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
486 wviminfo Xviminfo
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
487 sp Xviminfo
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
488 /^> .*Xtestfileintab
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
489 let lnum = line('.')
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
490 while 1
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
491 if lnum == line('$')
11183
1c4ebbae41d2 patch 8.0.0478: tests use assert_true(0) and assert_false(1) to report errors
Christian Brabandt <cb@256bit.org>
parents: 10285
diff changeset
492 call assert_report('mark not found in Xtestfileintab')
9875
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
493 break
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
494 endif
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
495 let lnum += 1
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
496 let line = getline(lnum)
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
497 if line == ''
11183
1c4ebbae41d2 patch 8.0.0478: tests use assert_true(0) and assert_false(1) to report errors
Christian Brabandt <cb@256bit.org>
parents: 10285
diff changeset
498 call assert_report('mark not found in Xtestfileintab')
9875
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
499 break
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
500 endif
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
501 if line =~ "^\t\""
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
502 call assert_equal('4', substitute(line, ".*\"\t\\(\\d\\).*", '\1', ''))
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
503 break
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
504 endif
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
505 endwhile
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
506
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
507 call delete('Xviminfo')
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
508 silent! bwipe Xtestfileintab
42adbf172ecd commit https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
Christian Brabandt <cb@256bit.org>
parents: 9414
diff changeset
509 endfunc
9915
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
510
10285
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
511 func Test_viminfo_file_mark_zero_time()
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
512 let lines = [
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
513 \ '# Viminfo version',
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
514 \ '|1,4',
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
515 \ '',
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
516 \ '*encoding=utf-8',
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
517 \ '',
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
518 \ '# File marks:',
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
519 \ "'B 1 0 /tmp/nothing",
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
520 \ '|4,66,1,0,0,"/tmp/nothing"',
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
521 \ "",
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
522 \ ]
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
523 call writefile(lines, 'Xviminfo')
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
524 delmark B
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
525 rviminfo Xviminfo
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
526 call delete('Xviminfo')
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
527 call assert_equal(1, line("'B"))
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
528 delmark B
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
529 endfunc
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
530
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
531 " Test for saving and restoring file marks in unloaded buffers
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
532 func Test_viminfo_file_mark_unloaded_buf()
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
533 let save_viminfo = &viminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
534 set viminfo&vim
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
535 call writefile(repeat(['vim'], 10), 'Xfile1')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
536 %bwipe
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
537 edit! Xfile1
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
538 call setpos("'u", [0, 3, 1, 0])
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
539 call setpos("'v", [0, 5, 1, 0])
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
540 enew
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
541 wviminfo Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
542 %bwipe
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
543 edit Xfile1
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
544 rviminfo! Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
545 call assert_equal([0, 3, 1, 0], getpos("'u"))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
546 call assert_equal([0, 5, 1, 0], getpos("'v"))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
547 %bwipe
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
548 call delete('Xfile1')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
549 call delete('Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
550 let &viminfo = save_viminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
551 endfunc
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
552
10285
cd16ef948ad1 commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640
Christian Brabandt <cb@256bit.org>
parents: 9978
diff changeset
553 func Test_viminfo_oldfiles()
9915
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
554 let v:oldfiles = []
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
555 let lines = [
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
556 \ '# comment line',
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
557 \ '*encoding=utf-8',
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
558 \ '',
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
559 \ ':h viminfo',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
560 \ '?/session',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
561 \ '=myvar',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
562 \ '@123',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
563 \ '',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
564 \ "'E 2 0 /tmp/nothing",
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
565 \ '',
9915
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
566 \ "> /tmp/file_one.txt",
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
567 \ "\t\"\t11\t0",
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
568 \ "",
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
569 \ "> /tmp/file_two.txt",
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
570 \ "\t\"\t11\t0",
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
571 \ "",
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
572 \ "> /tmp/another.txt",
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
573 \ "\t\"\t11\t0",
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
574 \ "",
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
575 \ ]
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
576 call writefile(lines, 'Xviminfo')
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
577 delmark E
9915
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
578 rviminfo! Xviminfo
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
579 call delete('Xviminfo')
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
580
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
581 call assert_equal('h viminfo', histget(':'))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
582 call assert_equal('session', histget('/'))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
583 call assert_equal('myvar', histget('='))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
584 call assert_equal('123', histget('@'))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
585 call assert_equal(2, line("'E"))
9941
e975914c17e9 commit https://github.com/vim/vim/commit/7b668e83d0635d082b7ec90d7d2aa30a9d7d8928
Christian Brabandt <cb@256bit.org>
parents: 9915
diff changeset
586 call assert_equal(['1: /tmp/file_one.txt', '2: /tmp/file_two.txt', '3: /tmp/another.txt'], filter(split(execute('oldfiles'), "\n"), {i, v -> v =~ '/tmp/'}))
e975914c17e9 commit https://github.com/vim/vim/commit/7b668e83d0635d082b7ec90d7d2aa30a9d7d8928
Christian Brabandt <cb@256bit.org>
parents: 9915
diff changeset
587 call assert_equal(['1: /tmp/file_one.txt', '2: /tmp/file_two.txt'], filter(split(execute('filter file_ oldfiles'), "\n"), {i, v -> v =~ '/tmp/'}))
e975914c17e9 commit https://github.com/vim/vim/commit/7b668e83d0635d082b7ec90d7d2aa30a9d7d8928
Christian Brabandt <cb@256bit.org>
parents: 9915
diff changeset
588 call assert_equal(['3: /tmp/another.txt'], filter(split(execute('filter /another/ oldfiles'), "\n"), {i, v -> v =~ '/tmp/'}))
17532
24d7a7d27471 patch 8.1.1764: ":browse oldfiles" is not tested
Bram Moolenaar <Bram@vim.org>
parents: 17466
diff changeset
589
24d7a7d27471 patch 8.1.1764: ":browse oldfiles" is not tested
Bram Moolenaar <Bram@vim.org>
parents: 17466
diff changeset
590 new
24d7a7d27471 patch 8.1.1764: ":browse oldfiles" is not tested
Bram Moolenaar <Bram@vim.org>
parents: 17466
diff changeset
591 call feedkeys("3\<CR>", 't')
24d7a7d27471 patch 8.1.1764: ":browse oldfiles" is not tested
Bram Moolenaar <Bram@vim.org>
parents: 17466
diff changeset
592 browse oldfiles
24d7a7d27471 patch 8.1.1764: ":browse oldfiles" is not tested
Bram Moolenaar <Bram@vim.org>
parents: 17466
diff changeset
593 call assert_equal("/tmp/another.txt", expand("%"))
24d7a7d27471 patch 8.1.1764: ":browse oldfiles" is not tested
Bram Moolenaar <Bram@vim.org>
parents: 17466
diff changeset
594 bwipe
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
595 delmark E
9915
4da1a3879100 commit https://github.com/vim/vim/commit/e11d61a3b1cdedf3144de697a2b38af62c3a78d8
Christian Brabandt <cb@256bit.org>
parents: 9875
diff changeset
596 endfunc
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
597
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
598 " Test for storing and restoring buffer list in 'viminfo'
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
599 func Test_viminfo_bufferlist()
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
600 " If there are arguments, then :rviminfo doesn't read the buffer list.
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
601 " Need to delete all the arguments for :rviminfo to work.
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
602 %argdelete
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
603
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
604 edit Xfile1
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
605 edit Xfile2
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
606 set viminfo-=%
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
607 wviminfo Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
608 %bwipe
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
609 rviminfo Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
610 call assert_equal(1, len(getbufinfo()))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
611
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
612 edit Xfile1
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
613 edit Xfile2
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
614 set viminfo^=%
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
615 wviminfo Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
616 %bwipe
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
617 rviminfo Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
618 let l = getbufinfo()
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
619 call assert_equal(3, len(l))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
620 call assert_equal('Xfile1', bufname(l[1].bufnr))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
621 call assert_equal('Xfile2', bufname(l[2].bufnr))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
622
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
623 call delete('Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
624 %bwipe
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
625 set viminfo-=%
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
626 endfunc
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
627
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
628 " Test for errors in a viminfo file
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
629 func Test_viminfo_error()
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
630 " Non-existing viminfo files
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
631 call assert_fails('rviminfo xyz', 'E195:')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
632
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
633 " Illegal starting character
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
634 call writefile(["a 123"], 'Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
635 call assert_fails('rv Xviminfo', 'E575:')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
636
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
637 " Illegal register name in the viminfo file
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
638 call writefile(['"@ LINE 0'], 'Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
639 call assert_fails('rv Xviminfo', 'E577:')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
640
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
641 " Invalid file mark line
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
642 call writefile(['>', '@'], 'Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
643 call assert_fails('rv Xviminfo', 'E576:')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
644
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
645 " Too many errors in viminfo file
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
646 call writefile(repeat(["a 123"], 15), 'Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
647 call assert_fails('rv Xviminfo', 'E136:')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
648
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
649 call writefile(['>'] + repeat(['@'], 10), 'Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
650 call assert_fails('rv Xviminfo', 'E136:')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
651
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
652 call writefile(repeat(['"@'], 15), 'Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
653 call assert_fails('rv Xviminfo', 'E136:')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
654
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
655 call delete('Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
656 endfunc
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
657
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
658 " Test for saving and restoring last substitute string in viminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
659 func Test_viminfo_lastsub()
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
660 enew
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
661 call append(0, "blue blue blue")
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
662 call cursor(1, 1)
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
663 s/blue/green/
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
664 wviminfo Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
665 s/blue/yellow/
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
666 rviminfo! Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
667 &
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
668 call assert_equal("green yellow green", getline(1))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
669 enew!
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
670 call delete('Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
671 endfunc
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
672
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
673 " Test saving and restoring the register values using the older method
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
674 func Test_viminfo_registers_old()
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
675 let lines = [
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
676 \ '# Viminfo version',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
677 \ '|1,1',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
678 \ '',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
679 \ '*encoding=utf-8',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
680 \ '',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
681 \ '# Registers:',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
682 \ '""0 CHAR 0',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
683 \ ' Vim',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
684 \ '"a CHAR 0',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
685 \ ' red',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
686 \ '"m@ CHAR 0',
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
687 \ " :echo 'Hello'\<CR>",
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
688 \ "",
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
689 \ ]
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
690 call writefile(lines, 'Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
691 let @a = 'one'
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
692 let @b = 'two'
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
693 let @m = 'three'
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
694 let @" = 'four'
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
695 let @t = ":echo 'Unix'\<CR>"
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
696 silent! normal @t
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
697 rviminfo! Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
698 call assert_equal('red', getreg('a'))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
699 call assert_equal('two', getreg('b'))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
700 call assert_equal(":echo 'Hello'\<CR>", getreg('m'))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
701 call assert_equal('Vim', getreg('"'))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
702 call assert_equal("\nHello", execute('normal @@'))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
703 call delete('Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
704 let @" = ''
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
705 endfunc
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
706
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
707 " Test for saving and restoring large number of lines in a register
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
708 func Test_viminfo_large_register()
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
709 let save_viminfo = &viminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
710 set viminfo&vim
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
711 set viminfo-=<50
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
712 set viminfo+=<200
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
713 let lines = ['"r CHAR 0']
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
714 call extend(lines, repeat(["\tsun is rising"], 200))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
715 call writefile(lines, 'Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
716 let @r = ''
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
717 rviminfo! Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
718 call assert_equal(join(repeat(["sun is rising"], 200), "\n"), @r)
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
719 call delete('Xviminfo')
18263
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
720 let @r = ''
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
721 let &viminfo = save_viminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
722 endfunc
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
723
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
724 " Test for setting 'viminfofile' to NONE
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
725 func Test_viminfofile_none()
18263
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
726 let save_vif = &viminfofile
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
727 set viminfofile=NONE
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
728 wviminfo Xviminfo
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
729 call assert_false(filereadable('Xviminfo'))
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
730 call writefile([''], 'Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
731 call assert_fails('rviminfo Xviminfo', 'E195:')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
732 call delete('Xviminfo')
18263
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
733 let &viminfofile = save_vif
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
734 endfunc
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
735
18263
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
736 " Test for an unwritable and unreadble 'viminfo' file
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
737 func Test_viminfo_perm()
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
738 CheckUnix
18277
f6dcf7eabd26 patch 8.1.2133: some tests fail when run as root
Bram Moolenaar <Bram@vim.org>
parents: 18263
diff changeset
739 CheckNotRoot
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
740 call writefile([''], 'Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
741 call setfperm('Xviminfo', 'r-x------')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
742 call assert_fails('wviminfo Xviminfo', 'E137:')
18263
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
743 call setfperm('Xviminfo', '--x------')
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
744 call assert_fails('rviminfo Xviminfo', 'E195:')
18233
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
745 call delete('Xviminfo')
7d147c191ef7 patch 8.1.2111: viminfo file not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
746 endfunc
18263
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
747
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
748 " Test for writing to an existing viminfo file merges the file marks
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
749 func XTest_viminfo_marks_merge()
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
750 let save_viminfo = &viminfo
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
751 set viminfo&vim
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
752 set viminfo^=%
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
753 enew
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
754 %argdelete
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
755 %bwipe
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
756
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
757 call writefile(repeat(['editor'], 10), 'Xbufa')
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
758 call writefile(repeat(['Vim'], 10), 'Xbufb')
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
759
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
760 " set marks in buffers
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
761 call test_settime(10)
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
762 edit Xbufa
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
763 4mark a
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
764 wviminfo Xviminfo
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
765 edit Xbufb
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
766 4mark b
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
767 wviminfo Xviminfo
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
768 %bwipe
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
769
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
770 " set marks in buffers again
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
771 call test_settime(20)
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
772 edit Xbufb
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
773 6mark b
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
774 wviminfo Xviminfo
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
775 edit Xbufa
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
776 6mark a
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
777 wviminfo Xviminfo
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
778 %bwipe
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
779
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
780 " Load the buffer and check the marks
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
781 edit Xbufa
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
782 rviminfo! Xviminfo
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
783 call assert_equal(6, line("'a"))
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
784 edit Xbufb
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
785 rviminfo! Xviminfo
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
786 call assert_equal(6, line("'b"))
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
787
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
788 " cleanup
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
789 %bwipe
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
790 call delete('Xviminfo')
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
791 call delete('Xbufa')
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
792 call delete('Xbufb')
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
793 call test_settime(0)
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
794 let &viminfo=save_viminfo
a5de1d88590d patch 8.1.2126: viminfo not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 18233
diff changeset
795 endfunc