annotate src/testdir/test_mksession.vim @ 12291:c3548d947646 v8.0.1025

patch 8.0.1025: stray copy command in test commit https://github.com/vim/vim/commit/4e83961985abb78757b135f29ac4ffde675247af Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 30 21:58:03 2017 +0200 patch 8.0.1025: stray copy command in test Problem: Stray copy command in test. Solution: Remove the copy command.
author Christian Brabandt <cb@256bit.org>
date Wed, 30 Aug 2017 22:00:05 +0200
parents 294f510f6d35
children fa198b71bab2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for :mksession, :mkview and :loadview in latin1 encoding
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 set encoding=latin1
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 scriptencoding latin1
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 if !has('multi_byte') || !has('mksession')
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 finish
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 endif
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 func Test_mksession()
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 tabnew
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 let wrap_save = &wrap
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 set sessionoptions=buffers splitbelow fileencoding=latin1
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call setline(1, [
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 \ 'start:',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 \ 'no multibyte chAracter',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 \ ' one leaDing tab',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 \ ' four leadinG spaces',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 \ 'two consecutive tabs',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 \ 'two tabs in one line',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ 'one ä multibyteCharacter',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ 'aä Ä two multiByte characters',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 \ 'Aäöü three mulTibyte characters'
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 \ ])
10737
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
25 let tmpfile = 'Xtemp'
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 exec 'w! ' . tmpfile
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 /^start:
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 set wrap
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 vsplit
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 norm! j8|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 norm! j8|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 norm! j16|
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 wincmd l
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 set nowrap
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 /^start:
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 norm! j16|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 norm! j08|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 norm! j08|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 norm! j016|3zl
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 split
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 call wincol()
10737
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
66 mksession! Xtest_mks.out
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
67 let li = filter(readfile('Xtest_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 let expected = [
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 \ 'normal! 08|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 \ 'normal! 08|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 \ 'normal! 016|',
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 \ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 \ " normal! 08|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 \ " exe 'normal! ' . s:c . '|zs' . 8 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 \ " normal! 08|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 \ " normal! 016|",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 \ " exe 'normal! ' . s:c . '|zs' . 16 . '|'",
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 \ " normal! 016|"
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 \ ]
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 call assert_equal(expected, li)
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 tabclose!
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98
10737
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
99 call delete('Xtest_mks.out')
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 call delete(tmpfile)
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 let &wrap = wrap_save
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 endfunc
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103
10726
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
104 func Test_mksession_winheight()
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
105 new
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
106 set winheight=10 winminheight=2
10737
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
107 mksession! Xtest_mks.out
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
108 source Xtest_mks.out
10726
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
109
10737
52c96cc9a794 patch 8.0.0258: mksession test leaves file behind
Christian Brabandt <cb@256bit.org>
parents: 10726
diff changeset
110 call delete('Xtest_mks.out')
10726
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
111 endfunc
78927b31c73a patch 8.0.0253: error when loading session if winminheight is 2
Christian Brabandt <cb@256bit.org>
parents: 10436
diff changeset
112
10809
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
113 func Test_mksession_arglist()
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
114 argdel *
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
115 next file1 file2 file3 file4
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
116 mksession! Xtest_mks.out
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
117 source Xtest_mks.out
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
118 call assert_equal(['file1', 'file2', 'file3', 'file4'], argv())
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
119
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
120 call delete('Xtest_mks.out')
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
121 argdel *
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
122 endfunc
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
123
12289
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
124 func Test_mksession_one_buffer_two_windows()
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
125 edit Xtest1
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
126 new Xtest2
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
127 split
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
128 mksession! Xtest_mks.out
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
129 let lines = readfile('Xtest_mks.out')
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
130 let count1 = 0
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
131 let count2 = 0
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
132 let count2buf = 0
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
133 for line in lines
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
134 if line =~ 'edit \f*Xtest1$'
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
135 let count1 += 1
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
136 endif
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
137 if line =~ 'edit \f\{-}Xtest2'
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
138 let count2 += 1
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
139 endif
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
140 if line =~ 'buffer \f\{-}Xtest2'
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
141 let count2buf += 1
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
142 endif
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
143 endfor
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
144 call assert_equal(1, count1, 'Xtest1 count')
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
145 call assert_equal(2, count2, 'Xtest2 count')
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
146 call assert_equal(2, count2buf, 'Xtest2 buffer count')
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
147
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
148 close
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
149 bwipe!
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
150 call delete('Xtest_mks.out')
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
151 endfunc
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
152
294f510f6d35 patch 8.0.1024: folds lost when session file has a buffer in two windows
Christian Brabandt <cb@256bit.org>
parents: 10809
diff changeset
153
10809
3adae5c1b1cd patch 8.0.0294: argument list is not stored correctly in a session file
Christian Brabandt <cb@256bit.org>
parents: 10737
diff changeset
154
10436
cb856404d060 commit https://github.com/vim/vim/commit/eca626fcdb73d480660c78b9f84cc043fa561922
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
155 " vim: shiftwidth=2 sts=2 expandtab