annotate src/testdir/test_window_cmd.vim @ 15012:55663ef68467 v8.1.0517

patch 8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor commit https://github.com/vim/vim/commit/d42333d8e9f6c157884f4f1acb458aa992f94f3d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 10 20:28:19 2018 +0100 patch 8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor Problem: Test_window_split_edit_alternate() fails on AppVeyor. Solution: Disable the failing part for now.
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Nov 2018 20:30:05 +0100
parents 1fd8e32532f7
children cc4c41448d77
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()
13880
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
20 let efmt = 'Expected 0 but got %d (in ls=%d, %s window)'
9102
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
15006
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
106 " Test the ":wincmd ^" and "<C-W>^" commands.
11197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
107 func Test_window_split_edit_alternate()
15006
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
108
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
109 " Test for failure when the alternate buffer/file no longer exists.
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
110 edit Xfoo | %bw
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
111 call assert_fails(':wincmd ^', 'E23')
11197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
112
15006
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
113 " Test for the expected behavior when we have two named buffers.
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
114 edit Xfoo | edit Xbar
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
115 wincmd ^
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
116 call assert_equal('Xfoo', bufname(winbufnr(1)))
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
117 call assert_equal('Xbar', bufname(winbufnr(2)))
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
118 only
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
119
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
120 " Test for the expected behavior when the alternate buffer is not named.
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
121 enew | let l:nr1 = bufnr('%')
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
122 edit Xfoo | let l:nr2 = bufnr('%')
11197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
123 wincmd ^
15006
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
124 call assert_equal(l:nr1, winbufnr(1))
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
125 call assert_equal(l:nr2, winbufnr(2))
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
126 only
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
127
15012
55663ef68467 patch 8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents: 15006
diff changeset
128 " FIXME: this currently fails on AppVeyor, but passes locally
55663ef68467 patch 8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents: 15006
diff changeset
129 if !has('win32')
55663ef68467 patch 8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents: 15006
diff changeset
130 " Test the Normal mode command.
55663ef68467 patch 8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents: 15006
diff changeset
131 call feedkeys("\<C-W>\<C-^>", 'tx')
55663ef68467 patch 8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents: 15006
diff changeset
132 call assert_equal(l:nr2, winbufnr(1))
55663ef68467 patch 8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents: 15006
diff changeset
133 call assert_equal(l:nr1, winbufnr(2))
55663ef68467 patch 8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents: 15006
diff changeset
134 endif
15006
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
135
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
136 %bw!
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
137 endfunc
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
138
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
139 " Test the ":[count]wincmd ^" and "[count]<C-W>^" commands.
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
140 func Test_window_split_edit_bufnr()
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
141
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
142 %bwipeout
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
143 let l:nr = bufnr('%') + 1
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
144 call assert_fails(':execute "normal! ' . l:nr . '\<C-W>\<C-^>"', 'E92')
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
145 call assert_fails(':' . l:nr . 'wincmd ^', 'E16')
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
146 call assert_fails(':0wincmd ^', 'E16')
11197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
147
15006
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
148 edit Xfoo | edit Xbar | edit Xbaz
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
149 let l:foo_nr = bufnr('Xfoo')
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
150 let l:bar_nr = bufnr('Xbar')
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
151 let l:baz_nr = bufnr('Xbaz')
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
152
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
153 call feedkeys(l:foo_nr . "\<C-W>\<C-^>", 'tx')
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
154 call assert_equal('Xfoo', bufname(winbufnr(1)))
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
155 call assert_equal('Xbaz', bufname(winbufnr(2)))
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
156 only
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
157
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
158 call feedkeys(l:bar_nr . "\<C-W>\<C-^>", 'tx')
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
159 call assert_equal('Xbar', bufname(winbufnr(1)))
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
160 call assert_equal('Xfoo', bufname(winbufnr(2)))
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
161 only
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
162
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
163 execute l:baz_nr . 'wincmd ^'
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
164 call assert_equal('Xbaz', bufname(winbufnr(1)))
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
165 call assert_equal('Xbar', bufname(winbufnr(2)))
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
166
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
167 %bw!
11197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
168 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
169
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
170 func Test_window_preview()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
171 " Open a preview window
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
172 pedit Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
173 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
174 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
175
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
176 " 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
177 wincmd P
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
178 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
179
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
180 " Close preview window
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
181 wincmd z
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
182 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
183 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
184
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
185 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
186 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
187
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
188 func Test_window_exchange()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
189 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
190
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
191 " 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
192 wincmd x
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
193 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
194
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
195 split Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
196 split Xc
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 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
199 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
200 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
201
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
202 " 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
203 3wincmd x
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
204 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
205 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
206 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
207
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
208 " 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
209 wincmd x
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
210 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
211 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
212 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
213
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
214 " 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
215 wincmd j
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
216 wincmd x
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
217 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
218 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
219 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
220
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
221 " 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
222 " 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
223 wincmd j
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
224 wincmd x
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
225 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
226 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
227 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
228
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
229 bw Xa Xb Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
230 endfunc
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 func Test_window_rotate()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
233 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
234 split Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
235 split Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
236 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
237 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
238 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
239
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
240 " Rotate downwards
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
241 wincmd r
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
242 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
243 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
244 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
245
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
246 2wincmd r
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
247 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
248 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
249 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
250
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
251 " Rotate upwards
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
252 wincmd R
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
253 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
254 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
255 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
256
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
257 2wincmd R
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
258 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
259 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
260 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
261
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
262 bot vsplit
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
263 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
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_height()
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 split 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 [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
273 " 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
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(wh2, wh2 + 1, wh1)
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(wh1 - 1, winheight(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(wh2 + 1, winheight(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(wh1, winheight(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(wh2, winheight(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, winheight(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(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
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(wh1, winheight(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(wh2, winheight(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 winfixheight
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
295 split Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
296 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
297 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
298 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
299 3wincmd +
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
300 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
301 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
302 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
303 wincmd =
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, winheight(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(wh1, winheight(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(wh3, winheight(3))
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
307
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
308 wincmd j
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
309 set winfixheight&
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
310
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
311 wincmd =
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
312 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
313 " 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
314 " than the other windows.
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
315 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
316 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
317
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
318 bw Xa Xb Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
319 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
320
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
321 func Test_window_width()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
322 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
323 vsplit Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
324
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
325 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
326 " 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
327 " than the other window.
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
328 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
329
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
330 wincmd <
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
331 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
332 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
333
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
334 wincmd >
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
335 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
336 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
337
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
338 2wincmd |
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
339 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
340 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
341
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
342 wincmd =
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
343 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
344 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
345
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
346 2wincmd |
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
347 set winfixwidth
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
348 vsplit Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
349 let [ww1, ww2, ww3] = [winwidth(1), winwidth(2), winwidth(3)]
11207
e6140f3d2be7 patch 8.0.0490: vertical split makes 'winfixwidth' window smaller
Christian Brabandt <cb@256bit.org>
parents: 11197
diff changeset
350 call assert_equal(2, winwidth(2))
11197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
351 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
352 3wincmd >
11207
e6140f3d2be7 patch 8.0.0490: vertical split makes 'winfixwidth' window smaller
Christian Brabandt <cb@256bit.org>
parents: 11197
diff changeset
353 call assert_equal(2, winwidth(2))
11197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
354 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
355 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
356 wincmd =
11207
e6140f3d2be7 patch 8.0.0490: vertical split makes 'winfixwidth' window smaller
Christian Brabandt <cb@256bit.org>
parents: 11197
diff changeset
357 call assert_equal(2, winwidth(2))
11197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
358 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
359 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
360
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
361 wincmd l
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
362 set winfixwidth&
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
363
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
364 wincmd =
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
365 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
366 " 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
367 " than the other windows.
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
368 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
369 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
370
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
371 bw Xa Xb Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
372 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
373
11591
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
374 func Test_equalalways_on_close()
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
375 set equalalways
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
376 vsplit
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
377 windo split
15006
1fd8e32532f7 patch 8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Bram Moolenaar <Bram@vim.org>
parents: 13880
diff changeset
378 split
11591
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
379 wincmd J
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
380 " now we have a frame top-left with two windows, a frame top-right with two
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
381 " windows and a frame at the bottom, full-width.
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
382 let height_1 = winheight(1)
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
383 let height_2 = winheight(2)
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
384 let height_3 = winheight(3)
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
385 let height_4 = winheight(4)
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
386 " closing the bottom window causes all windows to be resized.
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
387 close
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
388 call assert_notequal(height_1, winheight(1))
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
389 call assert_notequal(height_2, winheight(2))
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
390 call assert_notequal(height_3, winheight(3))
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
391 call assert_notequal(height_4, winheight(4))
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
392 call assert_equal(winheight(1), winheight(3))
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
393 call assert_equal(winheight(2), winheight(4))
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
394
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
395 1wincmd w
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
396 split
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
397 4wincmd w
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
398 resize + 5
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
399 " left column has three windows, equalized heights.
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
400 " right column has two windows, top one a bit higher
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
401 let height_1 = winheight(1)
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
402 let height_2 = winheight(2)
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
403 let height_4 = winheight(4)
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
404 let height_5 = winheight(5)
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
405 3wincmd w
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
406 " closing window in left column equalizes heights in left column but not in
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
407 " the right column
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
408 close
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
409 call assert_notequal(height_1, winheight(1))
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
410 call assert_notequal(height_2, winheight(2))
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
411 call assert_equal(height_4, winheight(3))
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
412 call assert_equal(height_5, winheight(4))
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
413
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
414 only
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
415 set equalalways&
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
416 endfunc
d06a3db9b651 patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents: 11207
diff changeset
417
12977
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
418 func Test_win_screenpos()
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
419 call assert_equal(1, winnr('$'))
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
420 split
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
421 vsplit
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
422 10wincmd _
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
423 30wincmd |
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
424 call assert_equal([1, 1], win_screenpos(1))
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
425 call assert_equal([1, 32], win_screenpos(2))
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
426 call assert_equal([12, 1], win_screenpos(3))
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
427 call assert_equal([0, 0], win_screenpos(4))
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
428 only
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
429 endfunc
2d817fd289ba patch 8.0.1364: there is no easy way to get the window position
Christian Brabandt <cb@256bit.org>
parents: 12019
diff changeset
430
11197
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
431 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
432 help
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
433 /iccf
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
434 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
435 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
436 2wincmd }
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
437 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
438 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
439 wincmd k
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
440 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
441 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
442
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
443 wincmd z
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
444 set previewheight=4
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
445 help
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
446 /bugs
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
447 wincmd }
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
448 wincmd k
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
449 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
450 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
451 set previewheight&
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
452
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
453 %bw!
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
454 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
455
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
456 func Test_window_newtab()
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
457 e Xa
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
458
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
459 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
460 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
461
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
462 split Xb
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
463 split Xc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
464
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
465 wincmd T
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
466 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
467 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
468 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
469
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
470 %bw!
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
471 endfunc
7f355d8cd634 patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents: 11193
diff changeset
472
11193
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
473 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
474 " 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
475 n x
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
476 norm axxx
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
477 split
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
478 split
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
479 s/x
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
480 s/x
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
481 all
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
482 bwipe!
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
483 endfunc
75ccc8a15a51 patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents: 9909
diff changeset
484
12019
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
485 " Tests for adjusting window and contents
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
486 func GetScreenStr(row)
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
487 let str = ""
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
488 for c in range(1,3)
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
489 let str .= nr2char(screenchar(a:row, c))
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
490 endfor
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
491 return str
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
492 endfunc
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
493
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
494 func Test_window_contents()
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
495 enew! | only | new
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
496 call setline(1, range(1,256))
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
497
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
498 exe "norm! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
499 redraw
13880
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
500 let s3 = GetScreenStr(1)
12019
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
501 wincmd p
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
502 call assert_equal(1, line("w0"))
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
503 call assert_equal('1 ', s3)
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
504
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
505 exe "norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
506 redraw
13880
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
507 let s3 = GetScreenStr(1)
12019
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
508 wincmd p
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
509 call assert_equal(50, line("w0"))
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
510 call assert_equal('50 ', s3)
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
511
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
512 exe "norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-W>+"
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
513 redraw
13880
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
514 let s3 = GetScreenStr(1)
12019
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
515 wincmd p
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
516 call assert_equal(59, line("w0"))
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
517 call assert_equal('59 ', s3)
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
518
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
519 bwipeout!
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
520 call test_garbagecollect_now()
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
521 endfunc
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents: 11591
diff changeset
522
13072
50aa6da392ce patch 8.0.1411: reading invalid memory with CTRL-W :
Christian Brabandt <cb@256bit.org>
parents: 12977
diff changeset
523 func Test_window_colon_command()
50aa6da392ce patch 8.0.1411: reading invalid memory with CTRL-W :
Christian Brabandt <cb@256bit.org>
parents: 12977
diff changeset
524 " This was reading invalid memory.
50aa6da392ce patch 8.0.1411: reading invalid memory with CTRL-W :
Christian Brabandt <cb@256bit.org>
parents: 12977
diff changeset
525 exe "norm! v\<C-W>:\<C-U>echo v:version"
50aa6da392ce patch 8.0.1411: reading invalid memory with CTRL-W :
Christian Brabandt <cb@256bit.org>
parents: 12977
diff changeset
526 endfunc
50aa6da392ce patch 8.0.1411: reading invalid memory with CTRL-W :
Christian Brabandt <cb@256bit.org>
parents: 12977
diff changeset
527
13144
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
528 func Test_access_freed_mem()
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
529 " This was accessing freed memory
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
530 au * 0 vs xxx
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
531 arg 0
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
532 argadd
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
533 all
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
534 all
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
535 au!
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
536 bwipe xxx
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
537 endfunc
20fb8c711050 patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents: 13072
diff changeset
538
13666
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
539 func Test_visual_cleared_after_window_split()
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
540 new | only!
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
541 let smd_save = &showmode
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
542 set showmode
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
543 let ls_save = &laststatus
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
544 set laststatus=1
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
545 call setline(1, ['a', 'b', 'c', 'd', ''])
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
546 norm! G
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
547 exe "norm! kkvk"
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
548 redraw
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
549 exe "norm! \<C-W>v"
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
550 redraw
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
551 " check if '-- VISUAL --' disappeared from command line
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
552 let columns = range(1, &columns)
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
553 let cmdlinechars = map(columns, 'nr2char(screenchar(&lines, v:val))')
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
554 let cmdline = join(cmdlinechars, '')
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
555 let cmdline_ltrim = substitute(cmdline, '^\s*', "", "")
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
556 let mode_shown = substitute(cmdline_ltrim, '\s*$', "", "")
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
557 call assert_equal('', mode_shown)
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
558 let &showmode = smd_save
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
559 let &laststatus = ls_save
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
560 bwipe!
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
561 endfunc
57da3d873f20 patch 8.0.1705: when making a vertical split the mode message isn't updated
Christian Brabandt <cb@256bit.org>
parents: 13144
diff changeset
562
13880
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
563 func Test_winrestcmd()
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
564 2split
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
565 3vsplit
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
566 let a = winrestcmd()
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
567 call assert_equal(2, winheight(0))
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
568 call assert_equal(3, winwidth(0))
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
569 wincmd =
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
570 call assert_notequal(2, winheight(0))
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
571 call assert_notequal(3, winwidth(0))
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
572 exe a
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
573 call assert_equal(2, winheight(0))
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
574 call assert_equal(3, winwidth(0))
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
575 only
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
576 endfunc
60e80884994d patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents: 13666
diff changeset
577
9909
3ee84d270ea7 commit https://github.com/vim/vim/commit/9e4d8215d386100ab660d7d11e6620fd148b605e
Christian Brabandt <cb@256bit.org>
parents: 9349
diff changeset
578 " vim: shiftwidth=2 sts=2 expandtab