Mercurial > vim
annotate src/testdir/test_window_cmd.vim @ 13686:61979a75435a v8.0.1715
patch 8.0.1715: terminal buffer can be 1 more than 'terminalscroll' lines
commit https://github.com/vim/vim/commit/8c94a549051cc4d4cbb8cabd321724a85fe40c23
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 15 12:55:13 2018 +0200
patch 8.0.1715: terminal buffer can be 1 more than 'terminalscroll' lines
Problem: Terminal buffer can be 1 more than 'terminalscroll' lines.
Solution: Change > to >=.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 15 Apr 2018 13:00:05 +0200 |
parents | 57da3d873f20 |
children | 60e80884994d |
rev | line source |
---|---|
9102
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for window cmd (:wincmd, :split, :vsplit, :resize and etc...) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_window_cmd_ls0_with_split() |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 set ls=0 |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 set splitbelow |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 split |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 quit |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call assert_equal(0, &lines - &cmdheight - winheight(0)) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 new | only! |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 " |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 set splitbelow&vim |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 botright split |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 quit |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call assert_equal(0, &lines - &cmdheight - winheight(0)) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 new | only! |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 set ls&vim |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 endfunc |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 func Test_window_cmd_cmdwin_with_vsp() |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 let efmt='Expected 0 but got %d (in ls=%d, %s window)' |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 for v in range(0, 2) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 exec "set ls=" . v |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 vsplit |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 call feedkeys("q:\<CR>") |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 let ac = &lines - (&cmdheight + winheight(0) + !!v) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 let emsg = printf(efmt, ac, v, 'left') |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 call assert_equal(0, ac, emsg) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 wincmd w |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 let ac = &lines - (&cmdheight + winheight(0) + !!v) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 let emsg = printf(efmt, ac, v, 'right') |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call assert_equal(0, ac, emsg) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 new | only! |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 endfor |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 set ls&vim |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 endfunc |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 |
9349
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
37 function Test_window_cmd_wincmd_gf() |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
38 let fname = 'test_gf.txt' |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
39 let swp_fname = '.' . fname . '.swp' |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
40 call writefile([], fname) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
41 call writefile([], swp_fname) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
42 function s:swap_exists() |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
43 let v:swapchoice = s:swap_choice |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
44 endfunc |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
45 augroup test_window_cmd_wincmd_gf |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
46 autocmd! |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
47 exec "autocmd SwapExists " . fname . " call s:swap_exists()" |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
48 augroup END |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
49 |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
50 call setline(1, fname) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
51 " (E)dit anyway |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
52 let s:swap_choice = 'e' |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
53 wincmd gf |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
54 call assert_equal(2, tabpagenr()) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
55 call assert_equal(fname, bufname("%")) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
56 quit! |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
57 |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
58 " (Q)uit |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
59 let s:swap_choice = 'q' |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
60 wincmd gf |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
61 call assert_equal(1, tabpagenr()) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
62 call assert_notequal(fname, bufname("%")) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
63 new | only! |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
64 |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
65 call delete(fname) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
66 call delete(swp_fname) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
67 augroup! test_window_cmd_wincmd_gf |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
68 endfunc |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
69 |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
70 func Test_window_quit() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
71 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
72 split Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
73 call assert_equal(2, winnr('$')) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
74 call assert_equal('Xb', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
75 call assert_equal('Xa', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
76 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
77 wincmd q |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
78 call assert_equal(1, winnr('$')) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
79 call assert_equal('Xa', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
80 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
81 bw Xa Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
82 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
83 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
84 func Test_window_horizontal_split() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
85 call assert_equal(1, winnr('$')) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
86 3wincmd s |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
87 call assert_equal(2, winnr('$')) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
88 call assert_equal(3, winheight(0)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
89 call assert_equal(winwidth(1), winwidth(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
90 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
91 call assert_fails('botright topleft wincmd s', 'E442:') |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
92 bw |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
93 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
94 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
95 func Test_window_vertical_split() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
96 call assert_equal(1, winnr('$')) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
97 3wincmd v |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
98 call assert_equal(2, winnr('$')) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
99 call assert_equal(3, winwidth(0)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
100 call assert_equal(winheight(1), winheight(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
101 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
102 call assert_fails('botright topleft wincmd v', 'E442:') |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
103 bw |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
104 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
105 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
106 func Test_window_split_edit_alternate() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
107 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
108 e Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
109 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
110 wincmd ^ |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
111 call assert_equal('Xa', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
112 call assert_equal('Xb', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
113 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
114 bw Xa Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
115 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
116 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
117 func Test_window_preview() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
118 " Open a preview window |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
119 pedit Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
120 call assert_equal(2, winnr('$')) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
121 call assert_equal(0, &previewwindow) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
122 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
123 " Go to the preview window |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
124 wincmd P |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
125 call assert_equal(1, &previewwindow) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
126 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
127 " Close preview window |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
128 wincmd z |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
129 call assert_equal(1, winnr('$')) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
130 call assert_equal(0, &previewwindow) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
131 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
132 call assert_fails('wincmd P', 'E441:') |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
133 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
134 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
135 func Test_window_exchange() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
136 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
137 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
138 " Nothing happens with window exchange when there is 1 window |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
139 wincmd x |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
140 call assert_equal(1, winnr('$')) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
141 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
142 split Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
143 split Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
144 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
145 call assert_equal('Xc', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
146 call assert_equal('Xb', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
147 call assert_equal('Xa', bufname(winbufnr(3))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
148 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
149 " Exchange current window 1 with window 3 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
150 3wincmd x |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
151 call assert_equal('Xa', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
152 call assert_equal('Xb', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
153 call assert_equal('Xc', bufname(winbufnr(3))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
154 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
155 " Exchange window with next when at the top window |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
156 wincmd x |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
157 call assert_equal('Xb', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
158 call assert_equal('Xa', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
159 call assert_equal('Xc', bufname(winbufnr(3))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
160 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
161 " Exchange window with next when at the middle window |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
162 wincmd j |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
163 wincmd x |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
164 call assert_equal('Xb', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
165 call assert_equal('Xc', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
166 call assert_equal('Xa', bufname(winbufnr(3))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
167 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
168 " Exchange window with next when at the bottom window. |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
169 " When there is no next window, it exchanges with the previous window. |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
170 wincmd j |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
171 wincmd x |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
172 call assert_equal('Xb', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
173 call assert_equal('Xa', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
174 call assert_equal('Xc', bufname(winbufnr(3))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
175 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
176 bw Xa Xb Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
177 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
178 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
179 func Test_window_rotate() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
180 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
181 split Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
182 split Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
183 call assert_equal('Xc', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
184 call assert_equal('Xb', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
185 call assert_equal('Xa', bufname(winbufnr(3))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
186 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
187 " Rotate downwards |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
188 wincmd r |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
189 call assert_equal('Xa', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
190 call assert_equal('Xc', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
191 call assert_equal('Xb', bufname(winbufnr(3))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
192 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
193 2wincmd r |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
194 call assert_equal('Xc', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
195 call assert_equal('Xb', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
196 call assert_equal('Xa', bufname(winbufnr(3))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
197 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
198 " Rotate upwards |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
199 wincmd R |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
200 call assert_equal('Xb', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
201 call assert_equal('Xa', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
202 call assert_equal('Xc', bufname(winbufnr(3))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
203 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
204 2wincmd R |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
205 call assert_equal('Xc', bufname(winbufnr(1))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
206 call assert_equal('Xb', bufname(winbufnr(2))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
207 call assert_equal('Xa', bufname(winbufnr(3))) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
208 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
209 bot vsplit |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
210 call assert_fails('wincmd R', 'E443:') |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
211 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
212 bw Xa Xb Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
213 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
214 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
215 func Test_window_height() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
216 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
217 split Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
218 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
219 let [wh1, wh2] = [winheight(1), winheight(2)] |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
220 " Active window (1) should have the same height or 1 more |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
221 " than the other window. |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
222 call assert_inrange(wh2, wh2 + 1, wh1) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
223 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
224 wincmd - |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
225 call assert_equal(wh1 - 1, winheight(1)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
226 call assert_equal(wh2 + 1, winheight(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
227 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
228 wincmd + |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
229 call assert_equal(wh1, winheight(1)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
230 call assert_equal(wh2, winheight(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
231 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
232 2wincmd _ |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
233 call assert_equal(2, winheight(1)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
234 call assert_equal(wh1 + wh2 - 2, winheight(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
235 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
236 wincmd = |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
237 call assert_equal(wh1, winheight(1)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
238 call assert_equal(wh2, winheight(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
239 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
240 2wincmd _ |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
241 set winfixheight |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
242 split Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
243 let [wh1, wh2, wh3] = [winheight(1), winheight(2), winheight(3)] |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
244 call assert_equal(2, winheight(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
245 call assert_inrange(wh3, wh3 + 1, wh1) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
246 3wincmd + |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
247 call assert_equal(2, winheight(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
248 call assert_equal(wh1 + 3, winheight(1)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
249 call assert_equal(wh3 - 3, winheight(3)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
250 wincmd = |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
251 call assert_equal(2, winheight(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
252 call assert_equal(wh1, winheight(1)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
253 call assert_equal(wh3, winheight(3)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
254 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
255 wincmd j |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
256 set winfixheight& |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
257 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
258 wincmd = |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
259 let [wh1, wh2, wh3] = [winheight(1), winheight(2), winheight(3)] |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
260 " Current window (2) should have the same height or 1 more |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
261 " than the other windows. |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
262 call assert_inrange(wh1, wh1 + 1, wh2) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
263 call assert_inrange(wh3, wh3 + 1, wh2) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
264 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
265 bw Xa Xb Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
266 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
267 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
268 func Test_window_width() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
269 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
270 vsplit Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
271 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
272 let [ww1, ww2] = [winwidth(1), winwidth(2)] |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
273 " Active window (1) should have the same width or 1 more |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
274 " than the other window. |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
275 call assert_inrange(ww2, ww2 + 1, ww1) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
276 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
277 wincmd < |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
278 call assert_equal(ww1 - 1, winwidth(1)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
279 call assert_equal(ww2 + 1, winwidth(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
280 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
281 wincmd > |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
282 call assert_equal(ww1, winwidth(1)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
283 call assert_equal(ww2, winwidth(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
284 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
285 2wincmd | |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
286 call assert_equal(2, winwidth(1)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
287 call assert_equal(ww1 + ww2 - 2, winwidth(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
288 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
289 wincmd = |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
290 call assert_equal(ww1, winwidth(1)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
291 call assert_equal(ww2, winwidth(2)) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
292 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
293 2wincmd | |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
294 set winfixwidth |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
295 vsplit Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
296 let [ww1, ww2, ww3] = [winwidth(1), winwidth(2), winwidth(3)] |
11207
e6140f3d2be7
patch 8.0.0490: vertical split makes 'winfixwidth' window smaller
Christian Brabandt <cb@256bit.org>
parents:
11197
diff
changeset
|
297 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
|
298 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
|
299 3wincmd > |
11207
e6140f3d2be7
patch 8.0.0490: vertical split makes 'winfixwidth' window smaller
Christian Brabandt <cb@256bit.org>
parents:
11197
diff
changeset
|
300 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
|
301 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
|
302 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
|
303 wincmd = |
11207
e6140f3d2be7
patch 8.0.0490: vertical split makes 'winfixwidth' window smaller
Christian Brabandt <cb@256bit.org>
parents:
11197
diff
changeset
|
304 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
|
305 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
|
306 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
|
307 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
308 wincmd l |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
309 set winfixwidth& |
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 [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
|
313 " 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
|
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(ww1, ww1 + 1, ww2) |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
316 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
|
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 |
11591
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
321 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
|
322 set equalalways |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
323 vsplit |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
324 windo split |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
325 split |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
326 wincmd J |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
327 " 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
|
328 " 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
|
329 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
|
330 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
|
331 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
|
332 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
|
333 " 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
|
334 close |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
335 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
|
336 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
|
337 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
|
338 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
|
339 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
|
340 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
|
341 |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
342 1wincmd w |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
343 split |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
344 4wincmd w |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
345 resize + 5 |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
346 " 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
|
347 " 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
|
348 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
|
349 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
|
350 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
|
351 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
|
352 3wincmd w |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
353 " 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
|
354 " the right column |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
355 close |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
356 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
|
357 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
|
358 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
|
359 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
|
360 |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
361 only |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
362 set equalalways& |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
363 endfunc |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
364 |
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
|
365 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
|
366 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
|
367 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
|
368 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
|
369 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
|
370 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
|
371 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
|
372 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
|
373 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
|
374 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
|
375 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
|
376 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
|
377 |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
378 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
|
379 help |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
380 /iccf |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
381 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
|
382 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
|
383 2wincmd } |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
384 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
|
385 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
|
386 wincmd k |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
387 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
|
388 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
|
389 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
390 wincmd z |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
391 set previewheight=4 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
392 help |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
393 /bugs |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
394 wincmd } |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
395 wincmd k |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
396 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
|
397 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
|
398 set previewheight& |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
399 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
400 %bw! |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
401 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
402 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
403 func Test_window_newtab() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
404 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
405 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
406 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
|
407 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
|
408 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
409 split Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
410 split Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
411 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
412 wincmd T |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
413 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
|
414 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
|
415 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
|
416 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
417 %bw! |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
418 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
419 |
11193
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
420 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
|
421 " 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
|
422 n x |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
423 norm axxx |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
424 split |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
425 split |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
426 s/x |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
427 s/x |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
428 all |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
429 bwipe! |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
430 endfunc |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
431 |
12019
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
432 " 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
|
433 func GetScreenStr(row) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
434 let str = "" |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
435 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
|
436 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
|
437 endfor |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
438 return str |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
439 endfunc |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
440 |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
441 func Test_window_contents() |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
442 enew! | only | new |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
443 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
|
444 |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
445 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
|
446 redraw |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
447 let s3=GetScreenStr(1) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
448 wincmd p |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
449 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
|
450 call assert_equal('1 ', s3) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
451 |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
452 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
|
453 redraw |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
454 let s3=GetScreenStr(1) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
455 wincmd p |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
456 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
|
457 call assert_equal('50 ', s3) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
458 |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
459 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
|
460 redraw |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
461 let s3=GetScreenStr(1) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
462 wincmd p |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
463 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
|
464 call assert_equal('59 ', s3) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
465 |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
466 bwipeout! |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
467 call test_garbagecollect_now() |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
468 endfunc |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
469 |
13072
50aa6da392ce
patch 8.0.1411: reading invalid memory with CTRL-W :
Christian Brabandt <cb@256bit.org>
parents:
12977
diff
changeset
|
470 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
|
471 " 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
|
472 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
|
473 endfunc |
50aa6da392ce
patch 8.0.1411: reading invalid memory with CTRL-W :
Christian Brabandt <cb@256bit.org>
parents:
12977
diff
changeset
|
474 |
13144
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
475 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
|
476 " 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
|
477 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
|
478 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
|
479 argadd |
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
480 all |
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
481 all |
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
482 au! |
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
483 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
|
484 endfunc |
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
485 |
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
|
486 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
|
487 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
|
488 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
|
489 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
|
490 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
|
491 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
|
492 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
|
493 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
|
494 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
|
495 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
|
496 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
|
497 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
|
498 " 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
|
499 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
|
500 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
|
501 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
|
502 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
|
503 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
|
504 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
|
505 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
|
506 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
|
507 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
|
508 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
|
509 |
9909
3ee84d270ea7
commit https://github.com/vim/vim/commit/9e4d8215d386100ab660d7d11e6620fd148b605e
Christian Brabandt <cb@256bit.org>
parents:
9349
diff
changeset
|
510 " vim: shiftwidth=2 sts=2 expandtab |