annotate src/testdir/test_window_cmd.vim @ 11197:7f355d8cd634 v8.0.0485

patch 8.0.0485: not all windows commands are tested commit https://github.com/vim/vim/commit/4520d440c59034452d1450b27fcd56825c090687 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 19 16:09:46 2017 +0100 patch 8.0.0485: not all windows commands are tested Problem: Not all windows commands are tested. Solution: Add more tests for windows commands. (Dominique Pelle, closes #1575) Run test_autocmd separately, it interferes with other tests. Fix tests that depended on side effects.
author Christian Brabandt <cb@256bit.org>
date Sun, 19 Mar 2017 16:15:04 +0100
parents 75ccc8a15a51
children e6140f3d2be7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9102
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for window cmd (:wincmd, :split, :vsplit, :resize and etc...)
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 func Test_window_cmd_ls0_with_split()
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 set ls=0
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 set splitbelow
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 split
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 quit
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 call assert_equal(0, &lines - &cmdheight - winheight(0))
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 new | only!
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 "
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 set splitbelow&vim
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 botright split
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 quit
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call assert_equal(0, &lines - &cmdheight - winheight(0))
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 new | only!
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 set ls&vim
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 endfunc
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 func Test_window_cmd_cmdwin_with_vsp()
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 let efmt='Expected 0 but got %d (in ls=%d, %s window)'
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 for v in range(0, 2)
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 exec "set ls=" . v
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 vsplit
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call feedkeys("q:\<CR>")
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 let ac = &lines - (&cmdheight + winheight(0) + !!v)
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 let emsg = printf(efmt, ac, v, 'left')
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 call assert_equal(0, ac, emsg)
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 wincmd w
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 let ac = &lines - (&cmdheight + winheight(0) + !!v)
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 let emsg = printf(efmt, ac, v, 'right')
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 call assert_equal(0, ac, emsg)
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 new | only!
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 endfor
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 set ls&vim
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 endfunc
0e90f3e13d88 commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36
9349
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
37 function Test_window_cmd_wincmd_gf()
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
38 let fname = 'test_gf.txt'
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
39 let swp_fname = '.' . fname . '.swp'
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
40 call writefile([], fname)
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
41 call writefile([], swp_fname)
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
42 function s:swap_exists()
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
43 let v:swapchoice = s:swap_choice
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
44 endfunc
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
45 augroup test_window_cmd_wincmd_gf
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
46 autocmd!
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
47 exec "autocmd SwapExists " . fname . " call s:swap_exists()"
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
48 augroup END
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
49
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
50 call setline(1, fname)
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
51 " (E)dit anyway
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
52 let s:swap_choice = 'e'
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
53 wincmd gf
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
54 call assert_equal(2, tabpagenr())
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
55 call assert_equal(fname, bufname("%"))
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
56 quit!
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
57
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
58 " (Q)uit
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
59 let s:swap_choice = 'q'
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
60 wincmd gf
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
61 call assert_equal(1, tabpagenr())
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
62 call assert_notequal(fname, bufname("%"))
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
63 new | only!
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
64
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
65 call delete(fname)
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
66 call delete(swp_fname)
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
67 augroup! test_window_cmd_wincmd_gf
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
68 endfunc
b24900b73f90 commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents: 9102
diff changeset
69
11197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
70 func Test_window_quit()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
71 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
72 split Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
73 call assert_equal(2, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
74 call assert_equal('Xb', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
75 call assert_equal('Xa', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
76
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
77 wincmd q
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
78 call assert_equal(1, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
79 call assert_equal('Xa', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
80
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
81 bw Xa Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
82 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
83
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
84 func Test_window_horizontal_split()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
85 call assert_equal(1, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
86 3wincmd s
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
87 call assert_equal(2, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
88 call assert_equal(3, winheight(0))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
89 call assert_equal(winwidth(1), winwidth(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
90
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
91 call assert_fails('botright topleft wincmd s', 'E442:')
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
92 bw
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
93 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
94
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
95 func Test_window_vertical_split()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
96 call assert_equal(1, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
97 3wincmd v
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
98 call assert_equal(2, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
99 call assert_equal(3, winwidth(0))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
100 call assert_equal(winheight(1), winheight(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
101
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
102 call assert_fails('botright topleft wincmd v', 'E442:')
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
103 bw
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
104 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
105
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
106 func Test_window_split_edit_alternate()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
107 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
108 e Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
109
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
110 wincmd ^
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
111 call assert_equal('Xa', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
112 call assert_equal('Xb', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
113
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
114 bw Xa Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
115 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
116
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
117 func Test_window_preview()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
118 " Open a preview window
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
119 pedit Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
120 call assert_equal(2, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
121 call assert_equal(0, &previewwindow)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
122
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
123 " Go to the preview window
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
124 wincmd P
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
125 call assert_equal(1, &previewwindow)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
126
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
127 " Close preview window
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
128 wincmd z
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
129 call assert_equal(1, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
130 call assert_equal(0, &previewwindow)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
131
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
132 call assert_fails('wincmd P', 'E441:')
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
133 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
134
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
135 func Test_window_exchange()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
136 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
137
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
138 " Nothing happens with window exchange when there is 1 window
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
139 wincmd x
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
140 call assert_equal(1, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
141
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
142 split Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
143 split Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
144
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
145 call assert_equal('Xc', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
146 call assert_equal('Xb', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
147 call assert_equal('Xa', bufname(winbufnr(3)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
148
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
149 " Exchange current window 1 with window 3
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
150 3wincmd x
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
151 call assert_equal('Xa', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
152 call assert_equal('Xb', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
153 call assert_equal('Xc', bufname(winbufnr(3)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
154
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
155 " Exchange window with next when at the top window
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
156 wincmd x
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
157 call assert_equal('Xb', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
158 call assert_equal('Xa', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
159 call assert_equal('Xc', bufname(winbufnr(3)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
160
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
161 " Exchange window with next when at the middle window
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
162 wincmd j
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
163 wincmd x
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
164 call assert_equal('Xb', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
165 call assert_equal('Xc', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
166 call assert_equal('Xa', bufname(winbufnr(3)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
167
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
168 " Exchange window with next when at the bottom window.
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
169 " When there is no next window, it exchanges with the previous window.
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
170 wincmd j
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
171 wincmd x
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
172 call assert_equal('Xb', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
173 call assert_equal('Xa', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
174 call assert_equal('Xc', bufname(winbufnr(3)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
175
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
176 bw Xa Xb Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
177 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
178
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
179 func Test_window_rotate()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
180 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
181 split Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
182 split Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
183 call assert_equal('Xc', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
184 call assert_equal('Xb', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
185 call assert_equal('Xa', bufname(winbufnr(3)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
186
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
187 " Rotate downwards
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
188 wincmd r
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
189 call assert_equal('Xa', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
190 call assert_equal('Xc', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
191 call assert_equal('Xb', bufname(winbufnr(3)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
192
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
193 2wincmd r
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
194 call assert_equal('Xc', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
195 call assert_equal('Xb', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
196 call assert_equal('Xa', bufname(winbufnr(3)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
198 " Rotate upwards
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
199 wincmd R
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
200 call assert_equal('Xb', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
201 call assert_equal('Xa', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
202 call assert_equal('Xc', bufname(winbufnr(3)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
203
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
204 2wincmd R
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
205 call assert_equal('Xc', bufname(winbufnr(1)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
206 call assert_equal('Xb', bufname(winbufnr(2)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
207 call assert_equal('Xa', bufname(winbufnr(3)))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
208
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
209 bot vsplit
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
210 call assert_fails('wincmd R', 'E443:')
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
211
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
212 bw Xa Xb Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
213 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
214
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
215 func Test_window_height()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
216 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
217 split Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
218
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
219 let [wh1, wh2] = [winheight(1), winheight(2)]
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
220 " Active window (1) should have the same height or 1 more
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
221 " than the other window.
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
222 call assert_inrange(wh2, wh2 + 1, wh1)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
223
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
224 wincmd -
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
225 call assert_equal(wh1 - 1, winheight(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
226 call assert_equal(wh2 + 1, winheight(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
227
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
228 wincmd +
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
229 call assert_equal(wh1, winheight(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
230 call assert_equal(wh2, winheight(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
231
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
232 2wincmd _
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
233 call assert_equal(2, winheight(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
234 call assert_equal(wh1 + wh2 - 2, winheight(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
235
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
236 wincmd =
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
237 call assert_equal(wh1, winheight(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
238 call assert_equal(wh2, winheight(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
239
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
240 2wincmd _
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
241 set winfixheight
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
242 split Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
243 let [wh1, wh2, wh3] = [winheight(1), winheight(2), winheight(3)]
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
244 call assert_equal(2, winheight(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
245 call assert_inrange(wh3, wh3 + 1, wh1)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
246 3wincmd +
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
247 call assert_equal(2, winheight(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
248 call assert_equal(wh1 + 3, winheight(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
249 call assert_equal(wh3 - 3, winheight(3))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
250 wincmd =
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
251 call assert_equal(2, winheight(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
252 call assert_equal(wh1, winheight(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
253 call assert_equal(wh3, winheight(3))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
254
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
255 wincmd j
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
256 set winfixheight&
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
257
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
258 wincmd =
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
259 let [wh1, wh2, wh3] = [winheight(1), winheight(2), winheight(3)]
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
260 " Current window (2) should have the same height or 1 more
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
261 " than the other windows.
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
262 call assert_inrange(wh1, wh1 + 1, wh2)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
263 call assert_inrange(wh3, wh3 + 1, wh2)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
264
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
265 bw Xa Xb Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
266 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
267
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
268 func Test_window_width()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
269 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
270 vsplit Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
271
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
272 let [ww1, ww2] = [winwidth(1), winwidth(2)]
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
273 " Active window (1) should have the same width or 1 more
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
274 " than the other window.
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
275 call assert_inrange(ww2, ww2 + 1, ww1)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
276
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
277 wincmd <
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
278 call assert_equal(ww1 - 1, winwidth(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
279 call assert_equal(ww2 + 1, winwidth(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
280
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
281 wincmd >
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
282 call assert_equal(ww1, winwidth(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
283 call assert_equal(ww2, winwidth(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
284
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
285 2wincmd |
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
286 call assert_equal(2, winwidth(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
287 call assert_equal(ww1 + ww2 - 2, winwidth(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
288
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
289 wincmd =
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
290 call assert_equal(ww1, winwidth(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
291 call assert_equal(ww2, winwidth(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
292
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
293 2wincmd |
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
294 set winfixwidth
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
295 vsplit Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
296 let [ww1, ww2, ww3] = [winwidth(1), winwidth(2), winwidth(3)]
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
297 " FIXME: commented out: I would expect the width of 2nd window to
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
298 " remain 2 but it's actually 1?!
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
299 "call assert_equal(2, winwidth(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
300 call assert_inrange(ww3, ww3 + 1, ww1)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
301 3wincmd >
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
302 " FIXME: commented out: I would expect the width of 2nd window to
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
303 " remain 2 but it's actually 1?!
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
304 "call assert_equal(2, winwidth(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
305 call assert_equal(ww1 + 3, winwidth(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
306 call assert_equal(ww3 - 3, winwidth(3))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
307 wincmd =
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
308 " FIXME: commented out: I would expect the width of 2nd window to
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
309 " remain 2 but it's actually 1?!
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
310 "call assert_equal(2, winwidth(2))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
311 call assert_equal(ww1, winwidth(1))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
312 call assert_equal(ww3, winwidth(3))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
313
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
314 wincmd l
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
315 set winfixwidth&
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
316
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
317 wincmd =
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
318 let [ww1, ww2, ww3] = [winwidth(1), winwidth(2), winwidth(3)]
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
319 " Current window (2) should have the same width or 1 more
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
320 " than the other windows.
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
321 call assert_inrange(ww1, ww1 + 1, ww2)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
322 call assert_inrange(ww3, ww3 + 1, ww2)
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
323
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
324 bw Xa Xb Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
325 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
326
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
327 func Test_window_jump_tag()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
328 help
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
329 /iccf
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
330 call assert_match('^|iccf|', getline('.'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
331 call assert_equal(2, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
332 2wincmd }
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
333 call assert_equal(3, winnr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
334 call assert_match('^|iccf|', getline('.'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
335 wincmd k
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
336 call assert_match('\*iccf\*', getline('.'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
337 call assert_equal(2, winheight(0))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
338
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
339 wincmd z
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
340 set previewheight=4
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
341 help
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
342 /bugs
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
343 wincmd }
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
344 wincmd k
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
345 call assert_match('\*bugs\*', getline('.'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
346 call assert_equal(4, winheight(0))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
347 set previewheight&
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
348
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
349 %bw!
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
350 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
351
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
352 func Test_window_newtab()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
353 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
354
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
355 call assert_equal(1, tabpagenr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
356 call assert_equal("\nAlready only one window", execute('wincmd T'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
357
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
358 split Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
359 split Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
360
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
361 wincmd T
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
362 call assert_equal(2, tabpagenr('$'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
363 call assert_equal(['Xb', 'Xa'], map(tabpagebuflist(1), 'bufname(v:val)'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
364 call assert_equal(['Xc' ], map(tabpagebuflist(2), 'bufname(v:val)'))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
365
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
366 %bw!
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
367 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
368
11193
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
369 func Test_next_split_all()
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
370 " This was causing an illegal memory access.
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
371 n x
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
372 norm axxx
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
373 split
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
374 split
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
375 s/x
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
376 s/x
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
377 all
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
378 bwipe!
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
379 endfunc
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
380
9909
3ee84d270ea7 commit https://github.com/vim/vim/commit/9e4d8215d386100ab660d7d11e6620fd148b605e
Christian Brabandt <cb@256bit.org>
parents: 9349
diff changeset
381 " vim: shiftwidth=2 sts=2 expandtab