Mercurial > vim
annotate src/testdir/test_window_cmd.vim @ 31283:0db9f6400e71 v9.0.0975
patch 9.0.0975: virtual text below empty line misplaced when 'number' set
Commit: https://github.com/vim/vim/commit/7c02ad9f8906b576e53a62342c68ae557f67bacc
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Nov 29 21:37:13 2022 +0000
patch 9.0.0975: virtual text below empty line misplaced when 'number' set
Problem: Virtual text below an empty line is misplaced when 'number' is
set.
Solution: Adjust the computations. (closes #11629)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 29 Nov 2022 22:45:03 +0100 |
parents | a9040128bc3b |
children | 97bb0811cfd4 |
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 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
3 source check.vim |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
4 source screendump.vim |
18253
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
5 |
9102
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 func Test_window_cmd_ls0_with_split() |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 set ls=0 |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 set splitbelow |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 split |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 quit |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 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
|
12 new | only! |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 " |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 set splitbelow&vim |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 botright split |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 quit |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 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
|
18 new | only! |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 set ls&vim |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 endfunc |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 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
|
23 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
|
24 for v in range(0, 2) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 exec "set ls=" . v |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 vsplit |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 call feedkeys("q:\<CR>") |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 let ac = &lines - (&cmdheight + winheight(0) + !!v) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 let emsg = printf(efmt, ac, v, 'left') |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 call assert_equal(0, ac, emsg) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 wincmd w |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 let ac = &lines - (&cmdheight + winheight(0) + !!v) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 let emsg = printf(efmt, ac, v, 'right') |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 call assert_equal(0, ac, emsg) |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 new | only! |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 endfor |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 set ls&vim |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 endfunc |
0e90f3e13d88
commit https://github.com/vim/vim/commit/991dea3ab185fb35e577ab0bdfd443cd4b43ccc6
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 |
29694
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
40 func Test_cmdheight_not_changed() |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
41 set cmdheight=2 |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
42 set winminheight=0 |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
43 augroup Maximize |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
44 autocmd WinEnter * wincmd _ |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
45 augroup END |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
46 split |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
47 tabnew |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
48 tabfirst |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
49 call assert_equal(2, &cmdheight) |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
50 |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
51 tabonly! |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
52 only |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
53 set winminwidth& cmdheight& |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
54 augroup Maximize |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
55 au! |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
56 augroup END |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
57 augroup! Maximize |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
58 endfunc |
cb4ddbe3caf3
patch 9.0.0187: command line height changes when maximizing window height
Bram Moolenaar <Bram@vim.org>
parents:
29546
diff
changeset
|
59 |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
60 " Test for jumping to windows |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
61 func Test_window_jump() |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
62 new |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
63 " jumping to a window with a count greater than the max windows |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
64 exe "normal 4\<C-W>w" |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
65 call assert_equal(2, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
66 only |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
67 endfunc |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
68 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
69 func Test_window_cmd_wincmd_gf() |
9349
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
70 let fname = 'test_gf.txt' |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
71 let swp_fname = '.' . fname . '.swp' |
30869
bff3fa5f4c74
patch 9.0.0769: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30665
diff
changeset
|
72 call writefile([], fname, 'D') |
bff3fa5f4c74
patch 9.0.0769: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30665
diff
changeset
|
73 call writefile([], swp_fname, 'D') |
9349
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
74 function s:swap_exists() |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
75 let v:swapchoice = s:swap_choice |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
76 endfunc |
17360
cb71b5e9e5d9
patch 8.1.1679: test using SwapExists autocommand file may fail
Bram Moolenaar <Bram@vim.org>
parents:
16690
diff
changeset
|
77 " Remove the catch-all that runtest.vim adds |
cb71b5e9e5d9
patch 8.1.1679: test using SwapExists autocommand file may fail
Bram Moolenaar <Bram@vim.org>
parents:
16690
diff
changeset
|
78 au! SwapExists |
9349
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
79 augroup test_window_cmd_wincmd_gf |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
80 autocmd! |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
81 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
|
82 augroup END |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
83 |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
84 call setline(1, fname) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
85 " (E)dit anyway |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
86 let s:swap_choice = 'e' |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
87 wincmd gf |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
88 call assert_equal(2, tabpagenr()) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
89 call assert_equal(fname, bufname("%")) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
90 quit! |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
91 |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
92 " (Q)uit |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
93 let s:swap_choice = 'q' |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
94 wincmd gf |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
95 call assert_equal(1, tabpagenr()) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
96 call assert_notequal(fname, bufname("%")) |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
97 new | only! |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
98 |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
99 augroup! test_window_cmd_wincmd_gf |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
100 endfunc |
b24900b73f90
commit https://github.com/vim/vim/commit/5d2ca0402954ff79b73d9c86cc16c8a6454b75a7
Christian Brabandt <cb@256bit.org>
parents:
9102
diff
changeset
|
101 |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
102 func Test_window_quit() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
103 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
104 split Xb |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
105 call assert_equal(2, '$'->winnr()) |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
106 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
|
107 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
|
108 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
109 wincmd q |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
110 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
|
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 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
113 bw Xa Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
114 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
115 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
116 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
|
117 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
|
118 3wincmd s |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
119 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
|
120 call assert_equal(3, winheight(0)) |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
121 call assert_equal(winwidth(1), 2->winwidth()) |
11197
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 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
|
124 bw |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
125 endfunc |
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 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
|
128 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
|
129 3wincmd v |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
130 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
|
131 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
|
132 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
|
133 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
134 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
|
135 bw |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
136 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
137 |
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
|
138 " 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
|
139 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
|
140 |
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 " 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
|
142 edit Xfoo | %bw |
22087
ff21e2962490
patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents:
22073
diff
changeset
|
143 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
|
144 |
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
|
145 " 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
|
146 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
|
147 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
|
148 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
|
149 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
|
150 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
|
151 |
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 " 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
|
153 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
|
154 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
|
155 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
|
156 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
|
157 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
|
158 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
|
159 |
15012
55663ef68467
patch 8.1.0517: Test_window_split_edit_alternate() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15006
diff
changeset
|
160 " 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
|
161 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
|
162 " 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
|
163 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
|
164 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
|
165 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
|
166 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
|
167 |
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
|
168 %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
|
169 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
|
170 |
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
|
171 " 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
|
172 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
|
173 |
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
|
174 %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
|
175 let l:nr = bufnr('%') + 1 |
22087
ff21e2962490
patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents:
22073
diff
changeset
|
176 call assert_fails(':execute "normal! ' . l:nr . '\<C-W>\<C-^>"', 'E92:') |
ff21e2962490
patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents:
22073
diff
changeset
|
177 call assert_fails(':' . l:nr . 'wincmd ^', 'E16:') |
ff21e2962490
patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents:
22073
diff
changeset
|
178 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
|
179 |
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
|
180 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
|
181 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
|
182 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
|
183 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
|
184 |
15014
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
185 " FIXME: this currently fails on AppVeyor, but passes locally |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
186 if !has('win32') |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
187 call feedkeys(l:foo_nr . "\<C-W>\<C-^>", 'tx') |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
188 call assert_equal('Xfoo', bufname(winbufnr(1))) |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
189 call assert_equal('Xbaz', bufname(winbufnr(2))) |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
190 only |
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
|
191 |
15014
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
192 call feedkeys(l:bar_nr . "\<C-W>\<C-^>", 'tx') |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
193 call assert_equal('Xbar', bufname(winbufnr(1))) |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
194 call assert_equal('Xfoo', bufname(winbufnr(2))) |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
195 only |
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
|
196 |
15014
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
197 execute l:baz_nr . 'wincmd ^' |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
198 call assert_equal('Xbaz', bufname(winbufnr(1))) |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
199 call assert_equal('Xbar', bufname(winbufnr(2))) |
cc4c41448d77
patch 8.1.0518: Test_window_split_edit_bufnr() fails on AppVeyor
Bram Moolenaar <Bram@vim.org>
parents:
15012
diff
changeset
|
200 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
|
201 |
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
|
202 %bw! |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
203 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
204 |
19740
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
205 func Test_window_split_no_room() |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
206 " N horizontal windows need >= 2*N + 1 lines: |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
207 " - 1 line + 1 status line in each window |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
208 " - 1 Ex command line |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
209 " |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
210 " 2*N + 1 <= &lines |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
211 " N <= (lines - 1)/2 |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
212 " |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
213 " Beyond that number of windows, E36: Not enough room is expected. |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
214 let hor_win_count = (&lines - 1)/2 |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
215 let hor_split_count = hor_win_count - 1 |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
216 for s in range(1, hor_split_count) | split | endfor |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
217 call assert_fails('split', 'E36:') |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
218 |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
219 " N vertical windows need >= 2*(N - 1) + 1 columns: |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
220 " - 1 column + 1 separator for each window (except last window) |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
221 " - 1 column for the last window which does not have separator |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
222 " |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
223 " 2*(N - 1) + 1 <= &columns |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
224 " 2*N - 1 <= &columns |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
225 " N <= (&columns + 1)/2 |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
226 let ver_win_count = (&columns + 1)/2 |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
227 let ver_split_count = ver_win_count - 1 |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
228 for s in range(1, ver_split_count) | vsplit | endfor |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
229 call assert_fails('vsplit', 'E36:') |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
230 |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
231 %bw! |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
232 endfunc |
a653d1a165ef
patch 8.2.0426: some errors were not tested for
Bram Moolenaar <Bram@vim.org>
parents:
19724
diff
changeset
|
233 |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
234 func Test_window_exchange() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
235 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
236 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
237 " 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
|
238 wincmd x |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
239 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
|
240 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
241 split Xb |
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 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
244 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
|
245 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
|
246 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
|
247 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
248 " 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
|
249 3wincmd x |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
250 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
|
251 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
|
252 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
|
253 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
254 " 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
|
255 wincmd x |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
256 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
|
257 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
|
258 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
|
259 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
260 " 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
|
261 wincmd j |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
262 wincmd x |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
263 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
|
264 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
|
265 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
|
266 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
267 " 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
|
268 " 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
|
269 wincmd j |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
270 wincmd x |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
271 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
|
272 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
|
273 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
|
274 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
275 bw Xa Xb Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
276 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
277 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
278 func Test_window_rotate() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
279 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
280 split Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
281 split Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
282 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
|
283 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
|
284 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
|
285 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
286 " Rotate downwards |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
287 wincmd r |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
288 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
|
289 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
|
290 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
|
291 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
292 2wincmd r |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
293 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
|
294 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
|
295 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
|
296 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
297 " Rotate upwards |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
298 wincmd R |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
299 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
|
300 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
|
301 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
|
302 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
303 2wincmd R |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
304 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
|
305 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
|
306 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
|
307 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
308 bot vsplit |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
309 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
|
310 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
311 bw Xa Xb Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
312 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
313 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
314 func Test_window_height() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
315 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
316 split Xb |
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 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
|
319 " 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
|
320 " than the other window. |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
321 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
|
322 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
323 wincmd - |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
324 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
|
325 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
|
326 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
327 wincmd + |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
328 call assert_equal(wh1, winheight(1)) |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
329 call assert_equal(wh2, 2->winheight()) |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
330 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
331 2wincmd _ |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
332 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
|
333 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
|
334 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
335 wincmd = |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
336 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
|
337 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
|
338 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
339 2wincmd _ |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
340 set winfixheight |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
341 split Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
342 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
|
343 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
|
344 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
|
345 3wincmd + |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
346 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
|
347 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
|
348 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
|
349 wincmd = |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
350 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
|
351 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
|
352 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
|
353 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
354 wincmd j |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
355 set winfixheight& |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
356 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
357 wincmd = |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
358 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
|
359 " 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
|
360 " than the other windows. |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
361 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
|
362 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
|
363 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
364 bw Xa Xb Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
365 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
366 |
30009
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
367 func Test_wincmd_equal() |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
368 edit Xone |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
369 below split Xtwo |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
370 rightbelow vsplit Xthree |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
371 call assert_equal('Xone', bufname(winbufnr(1))) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
372 call assert_equal('Xtwo', bufname(winbufnr(2))) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
373 call assert_equal('Xthree', bufname(winbufnr(3))) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
374 |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
375 " Xone and Xtwo should be about the same height |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
376 let [wh1, wh2] = [winheight(1), winheight(2)] |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
377 call assert_inrange(wh1 - 1, wh1 + 1, wh2) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
378 " Xtwo and Xthree should be about the same width |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
379 let [ww2, ww3] = [winwidth(2), winwidth(3)] |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
380 call assert_inrange(ww2 - 1, ww2 + 1, ww3) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
381 |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
382 1wincmd w |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
383 10wincmd _ |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
384 2wincmd w |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
385 20wincmd | |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
386 call assert_equal(10, winheight(1)) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
387 call assert_equal(20, winwidth(2)) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
388 |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
389 " equalizing horizontally doesn't change the heights |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
390 hor wincmd = |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
391 call assert_equal(10, winheight(1)) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
392 let [ww2, ww3] = [winwidth(2), winwidth(3)] |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
393 call assert_inrange(ww2 - 1, ww2 + 1, ww3) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
394 |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
395 2wincmd w |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
396 20wincmd | |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
397 call assert_equal(20, winwidth(2)) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
398 " equalizing vertically doesn't change the widths |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
399 vert wincmd = |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
400 call assert_equal(20, winwidth(2)) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
401 let [wh1, wh2] = [winheight(1), winheight(2)] |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
402 call assert_inrange(wh1 - 1, wh1 + 1, wh2) |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
403 |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
404 bwipe Xone Xtwo Xthree |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
405 endfunc |
b97a870a7c63
patch 9.0.0342: ":wincmd =" equalizes in two directions
Bram Moolenaar <Bram@vim.org>
parents:
30005
diff
changeset
|
406 |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
407 func Test_window_width() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
408 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
409 vsplit Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
410 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
411 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
|
412 " 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
|
413 " than the other window. |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
414 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
|
415 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
416 wincmd < |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
417 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
|
418 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
|
419 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
420 wincmd > |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
421 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
|
422 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
|
423 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
424 2wincmd | |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
425 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
|
426 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
|
427 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
428 wincmd = |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
429 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
|
430 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
|
431 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
432 2wincmd | |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
433 set winfixwidth |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
434 vsplit Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
435 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
|
436 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
|
437 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
|
438 3wincmd > |
11207
e6140f3d2be7
patch 8.0.0490: vertical split makes 'winfixwidth' window smaller
Christian Brabandt <cb@256bit.org>
parents:
11197
diff
changeset
|
439 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
|
440 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
|
441 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
|
442 wincmd = |
11207
e6140f3d2be7
patch 8.0.0490: vertical split makes 'winfixwidth' window smaller
Christian Brabandt <cb@256bit.org>
parents:
11197
diff
changeset
|
443 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
|
444 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
|
445 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
|
446 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
447 wincmd l |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
448 set winfixwidth& |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
449 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
450 wincmd = |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
451 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
|
452 " 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
|
453 " than the other windows. |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
454 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
|
455 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
|
456 |
24882
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24180
diff
changeset
|
457 " when the current window width is less than the new 'winwidth', the current |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24180
diff
changeset
|
458 " window width should be increased. |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24180
diff
changeset
|
459 enew | only |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24180
diff
changeset
|
460 split |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24180
diff
changeset
|
461 10vnew |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24180
diff
changeset
|
462 set winwidth=15 |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24180
diff
changeset
|
463 call assert_equal(15, winwidth(0)) |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24180
diff
changeset
|
464 |
4c1b6f3eb96b
patch 8.2.2979: not all options code is covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24180
diff
changeset
|
465 %bw! |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
466 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
467 |
11591
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
468 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
|
469 set equalalways |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
470 vsplit |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
471 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
|
472 split |
11591
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
473 wincmd J |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
474 " 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
|
475 " 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
|
476 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
|
477 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
|
478 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
|
479 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
|
480 " 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
|
481 close |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
482 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
|
483 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
|
484 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
|
485 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
|
486 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
|
487 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
|
488 |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
489 1wincmd w |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
490 split |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
491 4wincmd w |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
492 resize + 5 |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
493 " 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
|
494 " 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
|
495 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
|
496 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
|
497 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
|
498 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
|
499 3wincmd w |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
500 " 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
|
501 " the right column |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
502 close |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
503 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
|
504 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
|
505 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
|
506 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
|
507 |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
508 only |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
509 set equalalways& |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
510 endfunc |
d06a3db9b651
patch 8.0.0678: closing a window does not trigger resizing
Christian Brabandt <cb@256bit.org>
parents:
11207
diff
changeset
|
511 |
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
|
512 func Test_win_screenpos() |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18253
diff
changeset
|
513 CheckFeature quickfix |
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18253
diff
changeset
|
514 |
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
|
515 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
|
516 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
|
517 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
|
518 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
|
519 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
|
520 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
|
521 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
|
522 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
|
523 call assert_equal([0, 0], win_screenpos(4)) |
20178
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
524 call assert_fails('let l = win_screenpos([])', 'E745:') |
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
|
525 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
|
526 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
|
527 |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
528 func Test_window_jump_tag() |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18253
diff
changeset
|
529 CheckFeature quickfix |
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18253
diff
changeset
|
530 |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
531 help |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
532 /iccf |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
533 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
|
534 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
|
535 2wincmd } |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
536 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
|
537 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
|
538 wincmd k |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
539 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
|
540 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
|
541 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
542 wincmd z |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
543 set previewheight=4 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
544 help |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
545 /bugs |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
546 wincmd } |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
547 wincmd k |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
548 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
|
549 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
|
550 set previewheight& |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
551 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
552 %bw! |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
553 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
554 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
555 func Test_window_newtab() |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
556 e Xa |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
557 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
558 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
|
559 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
|
560 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
561 split Xb |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
562 split Xc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
563 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
564 wincmd T |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
565 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
|
566 call assert_equal(['Xb', 'Xa'], map(tabpagebuflist(1), 'bufname(v:val)')) |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17746
diff
changeset
|
567 call assert_equal(['Xc' ], map(2->tabpagebuflist(), 'bufname(v:val)')) |
19783
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19752
diff
changeset
|
568 call assert_equal(['Xc' ], map(tabpagebuflist(), 'bufname(v:val)')) |
11197
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
569 |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
570 %bw! |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
571 endfunc |
7f355d8cd634
patch 8.0.0485: not all windows commands are tested
Christian Brabandt <cb@256bit.org>
parents:
11193
diff
changeset
|
572 |
11193
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
573 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
|
574 " 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
|
575 n x |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
576 norm axxx |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
577 split |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
578 split |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
579 s/x |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
580 s/x |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
581 all |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
582 bwipe! |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
583 endfunc |
75ccc8a15a51
patch 8.0.0483: illegal memory access when using :all
Christian Brabandt <cb@256bit.org>
parents:
9909
diff
changeset
|
584 |
12019
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
585 " 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
|
586 func GetScreenStr(row) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
587 let str = "" |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
588 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
|
589 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
|
590 endfor |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
591 return str |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
592 endfunc |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
593 |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
594 func Test_window_contents() |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
595 enew! | only | new |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
596 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
|
597 |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
598 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
|
599 redraw |
13880
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
600 let s3 = GetScreenStr(1) |
12019
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
601 wincmd p |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
602 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
|
603 call assert_equal('1 ', s3) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
604 |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
605 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
|
606 redraw |
13880
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
607 let s3 = GetScreenStr(1) |
12019
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
608 wincmd p |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
609 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
|
610 call assert_equal('50 ', s3) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
611 |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
612 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
|
613 redraw |
13880
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
614 let s3 = GetScreenStr(1) |
12019
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
615 wincmd p |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
616 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
|
617 call assert_equal('59 ', s3) |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
618 |
19724
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19435
diff
changeset
|
619 %d |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19435
diff
changeset
|
620 call setline(1, ['one', 'two', 'three']) |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19435
diff
changeset
|
621 call assert_equal(1, line('w0')) |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19435
diff
changeset
|
622 call assert_equal(3, line('w$')) |
b3e93a05c3ca
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19435
diff
changeset
|
623 |
12019
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
624 bwipeout! |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
625 call test_garbagecollect_now() |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
626 endfunc |
7d7835ab8b37
patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
11591
diff
changeset
|
627 |
13072
50aa6da392ce
patch 8.0.1411: reading invalid memory with CTRL-W :
Christian Brabandt <cb@256bit.org>
parents:
12977
diff
changeset
|
628 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
|
629 " 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
|
630 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
|
631 endfunc |
50aa6da392ce
patch 8.0.1411: reading invalid memory with CTRL-W :
Christian Brabandt <cb@256bit.org>
parents:
12977
diff
changeset
|
632 |
13144
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
633 func Test_access_freed_mem() |
17516
711db62c8aca
patch 8.1.1756: autocommand that splits window messes up window layout
Bram Moolenaar <Bram@vim.org>
parents:
17360
diff
changeset
|
634 call assert_equal(&columns, winwidth(0)) |
23758
97296182d336
patch 8.2.2420: too many problems with using all autocommand events
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
635 " This was accessing freed memory (but with what events?) |
97296182d336
patch 8.2.2420: too many problems with using all autocommand events
Bram Moolenaar <Bram@vim.org>
parents:
23748
diff
changeset
|
636 au BufEnter,BufLeave,WinEnter,WinLeave 0 vs xxx |
13144
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
637 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
|
638 argadd |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
21020
diff
changeset
|
639 call assert_fails("all", "E242:") |
13144
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
640 au! |
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
641 bwipe xxx |
17516
711db62c8aca
patch 8.1.1756: autocommand that splits window messes up window layout
Bram Moolenaar <Bram@vim.org>
parents:
17360
diff
changeset
|
642 call assert_equal(&columns, winwidth(0)) |
13144
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
643 endfunc |
20fb8c711050
patch 8.0.1446: acessing freed memory after window command in auto command
Christian Brabandt <cb@256bit.org>
parents:
13072
diff
changeset
|
644 |
18253
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
645 func Test_insert_cleared_on_switch_to_term() |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
646 CheckFeature terminal |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
647 |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
648 set showmode |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
649 terminal |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
650 wincmd p |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
651 |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
652 call feedkeys("i\<C-O>", 'ntx') |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
653 redraw |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
654 |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
655 " The "-- (insert) --" indicator should be visible. |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
656 let chars = map(range(1, &columns), 'nr2char(screenchar(&lines, v:val))') |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
657 let str = trim(join(chars, '')) |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
658 call assert_equal('-- (insert) --', str) |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
659 |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
660 call feedkeys("\<C-W>p", 'ntx') |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
661 redraw |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
662 |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
663 " The "-- (insert) --" indicator should have been cleared. |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
664 let chars = map(range(1, &columns), 'nr2char(screenchar(&lines, v:val))') |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
665 let str = trim(join(chars, '')) |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
666 call assert_equal('', str) |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
667 |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
668 set showmode& |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
669 %bw! |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
670 endfunc |
783f796a1426
patch 8.1.2121: mode is not updated when switching to terminal
Bram Moolenaar <Bram@vim.org>
parents:
18049
diff
changeset
|
671 |
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
|
672 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
|
673 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
|
674 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
|
675 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
|
676 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
|
677 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
|
678 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
|
679 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
|
680 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
|
681 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
|
682 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
|
683 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
|
684 " 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
|
685 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
|
686 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
|
687 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
|
688 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
|
689 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
|
690 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
|
691 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
|
692 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
|
693 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
|
694 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
|
695 |
13880
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
696 func Test_winrestcmd() |
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
697 2split |
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
698 3vsplit |
24180
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
699 let restcmd = winrestcmd() |
13880
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
700 call assert_equal(2, winheight(0)) |
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
701 call assert_equal(3, winwidth(0)) |
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
702 wincmd = |
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
703 call assert_notequal(2, winheight(0)) |
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
704 call assert_notequal(3, winwidth(0)) |
24180
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
705 exe restcmd |
13880
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
706 call assert_equal(2, winheight(0)) |
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
707 call assert_equal(3, winwidth(0)) |
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
708 only |
24180
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
709 |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
710 wincmd v |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
711 wincmd s |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
712 wincmd v |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
713 redraw |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
714 let restcmd = winrestcmd() |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
715 wincmd _ |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
716 wincmd | |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
717 exe restcmd |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
718 redraw |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
719 call assert_equal(restcmd, winrestcmd()) |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
720 |
3c165c7432ff
patch 8.2.2631: commands from winrestcmd() do not always work properly
Bram Moolenaar <Bram@vim.org>
parents:
23758
diff
changeset
|
721 only |
13880
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
722 endfunc |
60e80884994d
patch 8.0.1811: no test for winrestcmd()
Christian Brabandt <cb@256bit.org>
parents:
13666
diff
changeset
|
723 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
15241
diff
changeset
|
724 func Fun_RenewFile() |
17746
a4e488a6655c
patch 8.1.1870: using :pedit from a help file sets help filetype
Bram Moolenaar <Bram@vim.org>
parents:
17516
diff
changeset
|
725 " Need to wait a bit for the timestamp to be older. |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17746
diff
changeset
|
726 let old_ftime = getftime("tmp.txt") |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17746
diff
changeset
|
727 while getftime("tmp.txt") == old_ftime |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17746
diff
changeset
|
728 sleep 100m |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17746
diff
changeset
|
729 silent execute '!echo "1" > tmp.txt' |
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17746
diff
changeset
|
730 endwhile |
15241
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
731 sp |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
732 wincmd p |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
733 edit! tmp.txt |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
15241
diff
changeset
|
734 endfunc |
15241
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
735 |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
736 func Test_window_prevwin() |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
737 " Can we make this work on MS-Windows? |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
738 CheckUnix |
15241
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
739 |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
740 set hidden autoread |
30869
bff3fa5f4c74
patch 9.0.0769: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30665
diff
changeset
|
741 call writefile(['2'], 'tmp.txt', 'D') |
15241
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
742 new tmp.txt |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
743 q |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
744 call Fun_RenewFile() |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
745 call assert_equal(2, winnr()) |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
746 wincmd p |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
747 call assert_equal(1, winnr()) |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
748 wincmd p |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
749 q |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
750 call Fun_RenewFile() |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
751 call assert_equal(2, winnr()) |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
752 wincmd p |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
753 call assert_equal(1, winnr()) |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
754 wincmd p |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
755 " reset |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
756 q |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
757 set hidden&vim autoread&vim |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
758 delfunc Fun_RenewFile |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
759 endfunc |
83ff85896a14
patch 8.1.0630: "wincmd p" does not work after using an autocmd window
Bram Moolenaar <Bram@vim.org>
parents:
15014
diff
changeset
|
760 |
15977
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
761 func Test_relative_cursor_position_in_one_line_window() |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
762 new |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
763 only |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
764 call setline(1, range(1, 10000)) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
765 normal 50% |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
766 let lnum = getcurpos()[1] |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
767 split |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
768 split |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
769 " make third window take as many lines as possible, other windows will |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
770 " become one line |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
771 3wincmd w |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
772 for i in range(1, &lines - 6) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
773 wincmd + |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
774 redraw! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
775 endfor |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
776 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
777 " first and second window should show cursor line |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
778 let wininfo = getwininfo() |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
779 call assert_equal(lnum, wininfo[0].topline) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
780 call assert_equal(lnum, wininfo[1].topline) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
781 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
782 only! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
783 bwipe! |
29994
86eb4aba16c3
patch 9.0.0335: checks for Dictionary argument often give a vague error
Bram Moolenaar <Bram@vim.org>
parents:
29694
diff
changeset
|
784 call assert_fails('call winrestview(test_null_dict())', 'E1297:') |
15977
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
785 endfunc |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
786 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
787 func Test_relative_cursor_position_after_move_and_resize() |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
788 let so_save = &so |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
789 set so=0 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
790 enew |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
791 call setline(1, range(1, 10000)) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
792 normal 50% |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
793 split |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
794 1wincmd w |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
795 " Move cursor to first line in window |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
796 normal H |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
797 redraw! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
798 " Reduce window height to two lines |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
799 let height = winheight(0) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
800 while winheight(0) > 2 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
801 wincmd - |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
802 redraw! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
803 endwhile |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
804 " move cursor to second/last line in window |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
805 normal j |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
806 " restore previous height |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
807 while winheight(0) < height |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
808 wincmd + |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
809 redraw! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
810 endwhile |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
811 " make window two lines again |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
812 while winheight(0) > 2 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
813 wincmd - |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
814 redraw! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
815 endwhile |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
816 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
817 " cursor should be at bottom line |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
818 let info = getwininfo(win_getid())[0] |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
819 call assert_equal(info.topline + 1, getcurpos()[1]) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
820 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
821 only! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
822 bwipe! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
823 let &so = so_save |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
824 endfunc |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
825 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
826 func Test_relative_cursor_position_after_resize() |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
827 let so_save = &so |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
828 set so=0 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
829 enew |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
830 call setline(1, range(1, 10000)) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
831 normal 50% |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
832 split |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
833 1wincmd w |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
834 let winid1 = win_getid() |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
835 let info = getwininfo(winid1)[0] |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
836 " Move cursor to second line in window |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
837 exe "normal " . (info.topline + 1) . "G" |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
838 redraw! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
839 let lnum = getcurpos()[1] |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
840 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
841 " Make the window only two lines high, cursor should end up in top line |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
842 2wincmd w |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
843 exe (info.height - 2) . "wincmd +" |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
844 redraw! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
845 let info = getwininfo(winid1)[0] |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
846 call assert_equal(lnum, info.topline) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
847 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
848 only! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
849 bwipe! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
850 let &so = so_save |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
851 endfunc |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
852 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
853 func Test_relative_cursor_second_line_after_resize() |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
854 let so_save = &so |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
855 set so=0 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
856 enew |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
857 call setline(1, range(1, 10000)) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
858 normal 50% |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
859 split |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
860 1wincmd w |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
861 let winid1 = win_getid() |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
862 let info = getwininfo(winid1)[0] |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
863 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
864 " Make the window only two lines high |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
865 2wincmd _ |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
866 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
867 " Move cursor to second line in window |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
868 normal H |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
869 normal j |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
870 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
871 " Make window size bigger, then back to 2 lines |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
872 for i in range(1, 10) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
873 wincmd + |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
874 redraw! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
875 endfor |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
876 for i in range(1, 10) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
877 wincmd - |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
878 redraw! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
879 endfor |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
880 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
881 " cursor should end up in bottom line |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
882 let info = getwininfo(winid1)[0] |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
883 call assert_equal(info.topline + 1, getcurpos()[1]) |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
884 |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
885 only! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
886 bwipe! |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
887 let &so = so_save |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
888 endfunc |
7fbdceabad64
patch 8.1.0994: relative cursor position is not calculated correctly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
889 |
16650
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
890 func Test_split_noscroll() |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
891 let so_save = &so |
16690
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
892 enew |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
893 call setline(1, range(1, 8)) |
16650
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
894 normal 100% |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
895 split |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
896 |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
897 1wincmd w |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
898 let winid1 = win_getid() |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
899 let info1 = getwininfo(winid1)[0] |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
900 |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
901 2wincmd w |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
902 let winid2 = win_getid() |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
903 let info2 = getwininfo(winid2)[0] |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
904 |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
905 call assert_equal(1, info1.topline) |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
906 call assert_equal(1, info2.topline) |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
907 |
16690
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
908 " window that fits all lines by itself, but not when split: closing other |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
909 " window should restore fraction. |
16650
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
910 only! |
16690
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
911 call setline(1, range(1, &lines - 10)) |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
912 exe &lines / 4 |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
913 let winid1 = win_getid() |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
914 let info1 = getwininfo(winid1)[0] |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
915 call assert_equal(1, info1.topline) |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
916 new |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
917 redraw |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
918 close |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
919 let info1 = getwininfo(winid1)[0] |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
920 call assert_equal(1, info1.topline) |
4e3c4e8e465c
patch 8.1.1347: fractional scroll position not restored after closing window
Bram Moolenaar <Bram@vim.org>
parents:
16650
diff
changeset
|
921 |
16650
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
922 bwipe! |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
923 let &so = so_save |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
924 endfunc |
06fd0eaada01
patch 8.1.1327: unnecessary scroll after horizontal split
Bram Moolenaar <Bram@vim.org>
parents:
16271
diff
changeset
|
925 |
16271
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
926 " Tests for the winnr() function |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
927 func Test_winnr() |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
928 only | tabonly |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
929 call assert_equal(1, winnr('j')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
930 call assert_equal(1, winnr('k')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
931 call assert_equal(1, winnr('h')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
932 call assert_equal(1, winnr('l')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
933 |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
934 " create a set of horizontally and vertically split windows |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
935 leftabove new | wincmd p |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
936 leftabove new | wincmd p |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
937 rightbelow new | wincmd p |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
938 rightbelow new | wincmd p |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
939 leftabove vnew | wincmd p |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
940 leftabove vnew | wincmd p |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
941 rightbelow vnew | wincmd p |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
942 rightbelow vnew | wincmd p |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
943 |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
944 call assert_equal(8, winnr('j')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
945 call assert_equal(2, winnr('k')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
946 call assert_equal(4, winnr('h')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
947 call assert_equal(6, winnr('l')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
948 call assert_equal(9, winnr('2j')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
949 call assert_equal(1, winnr('2k')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
950 call assert_equal(3, winnr('2h')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
951 call assert_equal(7, winnr('2l')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
952 |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
953 " Error cases |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
954 call assert_fails("echo winnr('0.2k')", 'E15:') |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
955 call assert_equal(2, winnr('-2k')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
956 call assert_fails("echo winnr('-2xj')", 'E15:') |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
957 call assert_fails("echo winnr('j2j')", 'E15:') |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
958 call assert_fails("echo winnr('ll')", 'E15:') |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
959 call assert_fails("echo winnr('5')", 'E15:') |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
960 call assert_equal(4, winnr('0h')) |
20178
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
961 call assert_fails("let w = winnr([])", 'E730:') |
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
962 call assert_equal('unknown', win_gettype(-1)) |
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
963 call assert_equal(-1, winheight(-1)) |
2fb397573541
patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents:
20120
diff
changeset
|
964 call assert_equal(-1, winwidth(-1)) |
16271
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
965 |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
966 tabnew |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
967 call assert_equal(8, tabpagewinnr(1, 'j')) |
18031
8a2fb21c23c0
patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17746
diff
changeset
|
968 call assert_equal(2, 1->tabpagewinnr('k')) |
16271
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
969 call assert_equal(4, tabpagewinnr(1, 'h')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
970 call assert_equal(6, tabpagewinnr(1, 'l')) |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
971 |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
972 only | tabonly |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
973 endfunc |
243cdc183ec9
patch 8.1.1140: not easy to find out what neighbors a window has
Bram Moolenaar <Bram@vim.org>
parents:
15977
diff
changeset
|
974 |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
975 func Test_winrestview() |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
976 split runtest.vim |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
977 normal 50% |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
978 let view = winsaveview() |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
979 close |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
980 split runtest.vim |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
981 eval view->winrestview() |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
982 call assert_equal(view, winsaveview()) |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
983 |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
984 bwipe! |
29994
86eb4aba16c3
patch 9.0.0335: checks for Dictionary argument often give a vague error
Bram Moolenaar <Bram@vim.org>
parents:
29694
diff
changeset
|
985 call assert_fails('call winrestview(test_null_dict())', 'E1297:') |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
986 endfunc |
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
18031
diff
changeset
|
987 |
18049
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
988 func Test_win_splitmove() |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18253
diff
changeset
|
989 CheckFeature quickfix |
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18253
diff
changeset
|
990 |
18049
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
991 edit a |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
992 leftabove split b |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
993 leftabove vsplit c |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
994 leftabove split d |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
995 call assert_equal(0, win_splitmove(winnr(), winnr('l'))) |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
996 call assert_equal(bufname(winbufnr(1)), 'c') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
997 call assert_equal(bufname(winbufnr(2)), 'd') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
998 call assert_equal(bufname(winbufnr(3)), 'b') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
999 call assert_equal(bufname(winbufnr(4)), 'a') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1000 call assert_equal(0, win_splitmove(winnr(), winnr('j'), {'vertical': 1})) |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1001 call assert_equal(0, win_splitmove(winnr(), winnr('j'), {'vertical': 1})) |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1002 call assert_equal(bufname(winbufnr(1)), 'c') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1003 call assert_equal(bufname(winbufnr(2)), 'b') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1004 call assert_equal(bufname(winbufnr(3)), 'd') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1005 call assert_equal(bufname(winbufnr(4)), 'a') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1006 call assert_equal(0, win_splitmove(winnr(), winnr('k'), {'vertical': 1})) |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1007 call assert_equal(bufname(winbufnr(1)), 'd') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1008 call assert_equal(bufname(winbufnr(2)), 'c') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1009 call assert_equal(bufname(winbufnr(3)), 'b') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1010 call assert_equal(bufname(winbufnr(4)), 'a') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1011 call assert_equal(0, win_splitmove(winnr(), winnr('j'), {'rightbelow': v:true})) |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1012 call assert_equal(bufname(winbufnr(1)), 'c') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1013 call assert_equal(bufname(winbufnr(2)), 'b') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1014 call assert_equal(bufname(winbufnr(3)), 'a') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1015 call assert_equal(bufname(winbufnr(4)), 'd') |
29994
86eb4aba16c3
patch 9.0.0335: checks for Dictionary argument often give a vague error
Bram Moolenaar <Bram@vim.org>
parents:
29694
diff
changeset
|
1016 call assert_fails('call win_splitmove(winnr(), winnr("k"), test_null_dict())', 'E1297:') |
18049
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1017 only | bd |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1018 |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1019 call assert_fails('call win_splitmove(winnr(), 123)', 'E957:') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1020 call assert_fails('call win_splitmove(123, winnr())', 'E957:') |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1021 call assert_fails('call win_splitmove(winnr(), winnr())', 'E957:') |
19065
ef3633932b0c
patch 8.2.0093: win_splitmove() can make Vim hang
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
1022 |
ef3633932b0c
patch 8.2.0093: win_splitmove() can make Vim hang
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
1023 tabnew |
ef3633932b0c
patch 8.2.0093: win_splitmove() can make Vim hang
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
1024 call assert_fails('call win_splitmove(1, win_getid(1, 1))', 'E957:') |
ef3633932b0c
patch 8.2.0093: win_splitmove() can make Vim hang
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
1025 tabclose |
18049
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1026 endfunc |
a9f1656f13c9
patch 8.1.2020: it is not easy to change the window layout
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
1027 |
19289
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19065
diff
changeset
|
1028 " Test for the :only command |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19065
diff
changeset
|
1029 func Test_window_only() |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19065
diff
changeset
|
1030 new |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19065
diff
changeset
|
1031 set modified |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19065
diff
changeset
|
1032 new |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19065
diff
changeset
|
1033 call assert_fails('only', 'E445:') |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19065
diff
changeset
|
1034 only! |
19425
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1035 " Test for :only with a count |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1036 let wid = win_getid() |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1037 new |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1038 new |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1039 3only |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1040 call assert_equal(1, winnr('$')) |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1041 call assert_equal(wid, win_getid()) |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1042 call assert_fails('close', 'E444:') |
67fbe280a502
patch 8.2.0270: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19370
diff
changeset
|
1043 call assert_fails('%close', 'E16:') |
19289
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19065
diff
changeset
|
1044 endfunc |
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
19065
diff
changeset
|
1045 |
19370
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1046 " Test for errors with :wincmd |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1047 func Test_wincmd_errors() |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1048 call assert_fails('wincmd g', 'E474:') |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1049 call assert_fails('wincmd ab', 'E474:') |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1050 endfunc |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1051 |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1052 " Test for errors with :winpos |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1053 func Test_winpos_errors() |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1054 if !has("gui_running") && !has('win32') |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1055 call assert_fails('winpos', 'E188:') |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1056 endif |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1057 call assert_fails('winpos 10', 'E466:') |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1058 endfunc |
02111977dd05
patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
1059 |
19435
8f8a5a15d00a
patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
1060 " Test for +cmd in a :split command |
8f8a5a15d00a
patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
1061 func Test_split_cmd() |
8f8a5a15d00a
patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
1062 split +set\ readonly |
8f8a5a15d00a
patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
1063 call assert_equal(1, &readonly) |
8f8a5a15d00a
patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
1064 call assert_equal(2, winnr('$')) |
8f8a5a15d00a
patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
1065 close |
8f8a5a15d00a
patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
1066 endfunc |
8f8a5a15d00a
patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19425
diff
changeset
|
1067 |
19748
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1068 " Create maximum number of horizontally or vertically split windows and then |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1069 " run commands that create a new horizontally/vertically split window |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1070 func Run_noroom_for_newwindow_test(dir_arg) |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1071 let dir = (a:dir_arg == 'v') ? 'vert ' : '' |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1072 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1073 " Open as many windows as possible |
19752
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19748
diff
changeset
|
1074 while v:true |
19748
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1075 try |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1076 exe dir . 'new' |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1077 catch /E36:/ |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1078 break |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1079 endtry |
19752
0927df746554
patch 8.2.0432: a few tests fail in a huge terminal
Bram Moolenaar <Bram@vim.org>
parents:
19748
diff
changeset
|
1080 endwhile |
19748
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1081 |
30869
bff3fa5f4c74
patch 9.0.0769: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30665
diff
changeset
|
1082 call writefile(['first', 'second', 'third'], 'Xnorfile1', 'D') |
bff3fa5f4c74
patch 9.0.0769: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30665
diff
changeset
|
1083 call writefile([], 'Xnorfile2', 'D') |
bff3fa5f4c74
patch 9.0.0769: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30665
diff
changeset
|
1084 call writefile([], 'Xnorfile3', 'D') |
19748
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1085 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1086 " Argument list related commands |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1087 args Xnorfile1 Xnorfile2 Xnorfile3 |
19748
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1088 next |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1089 for cmd in ['sargument 2', 'snext', 'sprevious', 'sNext', 'srewind', |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1090 \ 'sfirst', 'slast'] |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1091 call assert_fails(dir .. cmd, 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1092 endfor |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1093 %argdelete |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1094 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1095 " Buffer related commands |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1096 set modified |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1097 hide enew |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1098 for cmd in ['sbuffer Xnorfile1', 'sbnext', 'sbprevious', 'sbNext', 'sbrewind', |
19748
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1099 \ 'sbfirst', 'sblast', 'sball', 'sbmodified', 'sunhide'] |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1100 call assert_fails(dir .. cmd, 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1101 endfor |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1102 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1103 " Window related commands |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1104 for cmd in ['split', 'split Xnorfile2', 'new', 'new Xnorfile3', 'sview Xnorfile1', |
19748
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1105 \ 'sfind runtest.vim'] |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1106 call assert_fails(dir .. cmd, 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1107 endfor |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1108 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1109 " Help |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1110 call assert_fails(dir .. 'help', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1111 call assert_fails(dir .. 'helpgrep window', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1112 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1113 " Command-line window |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1114 if a:dir_arg == 'h' |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1115 " Cmd-line window is always a horizontally split window |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1116 call assert_beeps('call feedkeys("q:\<CR>", "xt")') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1117 endif |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1118 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1119 " Quickfix and location list window |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1120 if has('quickfix') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1121 cexpr '' |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1122 call assert_fails(dir .. 'copen', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1123 lexpr '' |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1124 call assert_fails(dir .. 'lopen', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1125 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1126 " Preview window |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1127 call assert_fails(dir .. 'pedit Xnorfile2', 'E36:') |
19748
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1128 call setline(1, 'abc') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1129 call assert_fails(dir .. 'psearch abc', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1130 endif |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1131 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1132 " Window commands (CTRL-W ^ and CTRL-W f) |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1133 if a:dir_arg == 'h' |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1134 call assert_fails('call feedkeys("\<C-W>^", "xt")', 'E36:') |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1135 call setline(1, 'Xnorfile1') |
19748
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1136 call assert_fails('call feedkeys("gg\<C-W>f", "xt")', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1137 endif |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1138 enew! |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1139 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1140 " Tag commands (:stag, :stselect and :stjump) |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1141 call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1142 \ "second\tXnorfile1\t2", |
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1143 \ "third\tXnorfile1\t3",], |
19748
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1144 \ 'Xtags') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1145 set tags=Xtags |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1146 call assert_fails(dir .. 'stag second', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1147 call assert_fails('call feedkeys(":" .. dir .. "stselect second\n1\n", "xt")', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1148 call assert_fails(dir .. 'stjump second', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1149 call assert_fails(dir .. 'ptag second', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1150 set tags& |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1151 call delete('Xtags') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1152 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1153 " :isplit and :dsplit |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1154 call setline(1, ['#define FOO 1', 'FOO']) |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1155 normal 2G |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1156 call assert_fails(dir .. 'isplit FOO', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1157 call assert_fails(dir .. 'dsplit FOO', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1158 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1159 " terminal |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1160 if has('terminal') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1161 call assert_fails(dir .. 'terminal', 'E36:') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1162 endif |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1163 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1164 %bwipe! |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1165 only |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1166 endfunc |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1167 |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1168 func Test_split_cmds_with_no_room() |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1169 call Run_noroom_for_newwindow_test('h') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1170 call Run_noroom_for_newwindow_test('v') |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1171 endfunc |
d089bd9511c0
patch 8.2.0430: window creation failure not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19740
diff
changeset
|
1172 |
20120
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1173 " Test for various wincmd failures |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1174 func Test_wincmd_fails() |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1175 only! |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1176 call assert_beeps("normal \<C-W>w") |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1177 call assert_beeps("normal \<C-W>p") |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1178 call assert_beeps("normal \<C-W>gk") |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1179 call assert_beeps("normal \<C-W>r") |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1180 call assert_beeps("normal \<C-W>K") |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1181 call assert_beeps("normal \<C-W>H") |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1182 call assert_beeps("normal \<C-W>2gt") |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1183 endfunc |
16460964c304
patch 8.2.0615: regexp benchmark stest is old style
Bram Moolenaar <Bram@vim.org>
parents:
19932
diff
changeset
|
1184 |
22073
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1185 func Test_window_resize() |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1186 " Vertical :resize (absolute, relative, min and max size). |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1187 vsplit |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1188 vert resize 8 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1189 call assert_equal(8, winwidth(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1190 vert resize +2 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1191 call assert_equal(10, winwidth(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1192 vert resize -2 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1193 call assert_equal(8, winwidth(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1194 vert resize |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1195 call assert_equal(&columns - 2, winwidth(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1196 vert resize 0 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1197 call assert_equal(1, winwidth(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1198 vert resize 99999 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1199 call assert_equal(&columns - 2, winwidth(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1200 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1201 %bwipe! |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1202 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1203 " Horizontal :resize (with absolute, relative size, min and max size). |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1204 split |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1205 resize 8 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1206 call assert_equal(8, winheight(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1207 resize +2 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1208 call assert_equal(10, winheight(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1209 resize -2 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1210 call assert_equal(8, winheight(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1211 resize |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1212 call assert_equal(&lines - 4, winheight(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1213 resize 0 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1214 call assert_equal(1, winheight(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1215 resize 99999 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1216 call assert_equal(&lines - 4, winheight(0)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1217 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1218 " :resize with explicit window number. |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1219 let other_winnr = winnr('j') |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1220 exe other_winnr .. 'resize 10' |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1221 call assert_equal(10, winheight(other_winnr)) |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1222 call assert_equal(&lines - 10 - 3, winheight(0)) |
22616
f773ac13c093
patch 8.2.1856: "2resize" uses size of current window
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1223 exe other_winnr .. 'resize +1' |
f773ac13c093
patch 8.2.1856: "2resize" uses size of current window
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1224 exe other_winnr .. 'resize +1' |
f773ac13c093
patch 8.2.1856: "2resize" uses size of current window
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1225 call assert_equal(12, winheight(other_winnr)) |
f773ac13c093
patch 8.2.1856: "2resize" uses size of current window
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
1226 call assert_equal(&lines - 10 - 3 -2, winheight(0)) |
23402
65718283239b
patch 8.2.2244: crash when making the window width negative
Bram Moolenaar <Bram@vim.org>
parents:
22616
diff
changeset
|
1227 close |
65718283239b
patch 8.2.2244: crash when making the window width negative
Bram Moolenaar <Bram@vim.org>
parents:
22616
diff
changeset
|
1228 |
65718283239b
patch 8.2.2244: crash when making the window width negative
Bram Moolenaar <Bram@vim.org>
parents:
22616
diff
changeset
|
1229 vsplit |
65718283239b
patch 8.2.2244: crash when making the window width negative
Bram Moolenaar <Bram@vim.org>
parents:
22616
diff
changeset
|
1230 wincmd l |
65718283239b
patch 8.2.2244: crash when making the window width negative
Bram Moolenaar <Bram@vim.org>
parents:
22616
diff
changeset
|
1231 let other_winnr = winnr('h') |
65718283239b
patch 8.2.2244: crash when making the window width negative
Bram Moolenaar <Bram@vim.org>
parents:
22616
diff
changeset
|
1232 call assert_notequal(winnr(), other_winnr) |
23434
0fe2cdcff19b
patch 8.2.2260: window resize test fails in very wide terminal
Bram Moolenaar <Bram@vim.org>
parents:
23402
diff
changeset
|
1233 exe 'vert ' .. other_winnr .. 'resize -' .. &columns |
23402
65718283239b
patch 8.2.2244: crash when making the window width negative
Bram Moolenaar <Bram@vim.org>
parents:
22616
diff
changeset
|
1234 call assert_equal(0, winwidth(other_winnr)) |
22073
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1235 |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1236 %bwipe! |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1237 endfunc |
28b302ccfe21
patch 8.2.1586: :resize command not fully tested
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1238 |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1239 " Test for adjusting the window width when a window is closed with some |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1240 " windows using 'winfixwidth' |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1241 func Test_window_width_adjust() |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1242 only |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1243 " Three vertical windows. Windows 1 and 2 have 'winfixwidth' set and close |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1244 " window 2. |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1245 wincmd v |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1246 vert resize 10 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1247 set winfixwidth |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1248 wincmd v |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1249 set winfixwidth |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1250 wincmd c |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1251 call assert_inrange(10, 12, winwidth(1)) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1252 " Three vertical windows. Windows 2 and 3 have 'winfixwidth' set and close |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1253 " window 3. |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1254 only |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1255 set winfixwidth |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1256 wincmd v |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1257 vert resize 10 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1258 set winfixwidth |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1259 wincmd v |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1260 set nowinfixwidth |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1261 wincmd b |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1262 wincmd c |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1263 call assert_inrange(10, 12, winwidth(2)) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1264 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1265 new | only |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1266 endfunc |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1267 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1268 " Test for jumping to a vertical/horizontal neighbor window based on the |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1269 " current cursor position |
30986
360f286b5869
patch 9.0.0828: various typos
Bram Moolenaar <Bram@vim.org>
parents:
30978
diff
changeset
|
1270 func Test_window_goto_neighbor() |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1271 %bw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1272 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1273 " Vertical window movement |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1274 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1275 " create the following window layout: |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1276 " +--+--+ |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1277 " |w1|w3| |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1278 " +--+ | |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1279 " |w2| | |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1280 " +--+--+ |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1281 " |w4 | |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1282 " +-----+ |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1283 new |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1284 vsplit |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1285 split |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1286 " vertically jump from w4 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1287 wincmd b |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1288 call setline(1, repeat(' ', &columns)) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1289 call cursor(1, 1) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1290 wincmd k |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1291 call assert_equal(2, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1292 wincmd b |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1293 call cursor(1, &columns) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1294 redraw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1295 wincmd k |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1296 call assert_equal(3, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1297 %bw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1298 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1299 " create the following window layout: |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1300 " +--+--+--+ |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1301 " |w1|w2|w3| |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1302 " +--+--+--+ |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1303 " |w4 | |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1304 " +--------+ |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1305 new |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1306 vsplit |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1307 vsplit |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1308 wincmd b |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1309 call setline(1, repeat(' ', &columns)) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1310 call cursor(1, 1) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1311 wincmd k |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1312 call assert_equal(1, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1313 wincmd b |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1314 call cursor(1, &columns / 2) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1315 redraw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1316 wincmd k |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1317 call assert_equal(2, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1318 wincmd b |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1319 call cursor(1, &columns) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1320 redraw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1321 wincmd k |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1322 call assert_equal(3, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1323 %bw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1324 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1325 " Horizontal window movement |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1326 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1327 " create the following window layout: |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1328 " +--+--+--+ |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1329 " |w1|w2|w4| |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1330 " +--+--+ | |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1331 " |w3 | | |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1332 " +-----+--+ |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1333 vsplit |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1334 split |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1335 vsplit |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1336 4wincmd l |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1337 call setline(1, repeat([' '], &lines)) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1338 call cursor(1, 1) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1339 redraw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1340 wincmd h |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1341 call assert_equal(2, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1342 4wincmd l |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1343 call cursor(&lines, 1) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1344 redraw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1345 wincmd h |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1346 call assert_equal(3, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1347 %bw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1348 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1349 " create the following window layout: |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1350 " +--+--+ |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1351 " |w1|w4| |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1352 " +--+ + |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1353 " |w2| | |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1354 " +--+ + |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1355 " |w3| | |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1356 " +--+--+ |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1357 vsplit |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1358 split |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1359 split |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1360 wincmd l |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1361 call setline(1, repeat([' '], &lines)) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1362 call cursor(1, 1) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1363 redraw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1364 wincmd h |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1365 call assert_equal(1, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1366 wincmd l |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1367 call cursor(&lines / 2, 1) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1368 redraw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1369 wincmd h |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1370 call assert_equal(2, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1371 wincmd l |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1372 call cursor(&lines, 1) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1373 redraw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1374 wincmd h |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1375 call assert_equal(3, winnr()) |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1376 %bw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1377 endfunc |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1378 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1379 " Test for an autocmd closing the destination window when jumping from one |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1380 " window to another. |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1381 func Test_close_dest_window() |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1382 split |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1383 edit Xdstfile |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1384 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1385 " Test for BufLeave |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1386 augroup T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1387 au! |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1388 au BufLeave Xdstfile $wincmd c |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1389 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1390 wincmd b |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1391 call assert_equal(1, winnr('$')) |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1392 call assert_equal('Xdstfile', @%) |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1393 augroup T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1394 au! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1395 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1396 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1397 " Test for WinLeave |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1398 new |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1399 wincmd p |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1400 augroup T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1401 au! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1402 au WinLeave * 1wincmd c |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1403 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1404 wincmd t |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1405 call assert_equal(1, winnr('$')) |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1406 call assert_equal('Xdstfile', @%) |
21020
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1407 augroup T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1408 au! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1409 augroup END |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1410 augroup! T1 |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1411 %bw! |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1412 endfunc |
6c634e63989c
patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents:
20178
diff
changeset
|
1413 |
26468
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1414 func Test_window_minimal_size() |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1415 set winminwidth=0 winminheight=0 |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1416 |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1417 " check size is fixed vertically |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1418 new |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1419 call win_execute(win_getid(2), 'wincmd _') |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1420 call assert_equal(0, winheight(0)) |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1421 call feedkeys('0', 'tx') |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1422 call assert_equal(1, winheight(0)) |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1423 bwipe! |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1424 |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1425 " check size is fixed horizontally |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1426 vert new |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1427 call win_execute(win_getid(2), 'wincmd |') |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1428 call assert_equal(0, winwidth(0)) |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1429 call feedkeys('0', 'tx') |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1430 call assert_equal(1, winwidth(0)) |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1431 bwipe! |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1432 |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1433 if has('timers') |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1434 " check size is fixed in Insert mode |
26520
bea106f5fd26
patch 8.2.3789: Test_window_minimal_size can fail on a slow machine
Bram Moolenaar <Bram@vim.org>
parents:
26468
diff
changeset
|
1435 func s:CheckSize(timer) abort |
bea106f5fd26
patch 8.2.3789: Test_window_minimal_size can fail on a slow machine
Bram Moolenaar <Bram@vim.org>
parents:
26468
diff
changeset
|
1436 call win_execute(win_getid(2), 'wincmd _') |
bea106f5fd26
patch 8.2.3789: Test_window_minimal_size can fail on a slow machine
Bram Moolenaar <Bram@vim.org>
parents:
26468
diff
changeset
|
1437 call assert_equal(0, winheight(0)) |
bea106f5fd26
patch 8.2.3789: Test_window_minimal_size can fail on a slow machine
Bram Moolenaar <Bram@vim.org>
parents:
26468
diff
changeset
|
1438 call feedkeys(" \<Esc>", 't!') |
bea106f5fd26
patch 8.2.3789: Test_window_minimal_size can fail on a slow machine
Bram Moolenaar <Bram@vim.org>
parents:
26468
diff
changeset
|
1439 endfunc |
26468
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1440 new |
26520
bea106f5fd26
patch 8.2.3789: Test_window_minimal_size can fail on a slow machine
Bram Moolenaar <Bram@vim.org>
parents:
26468
diff
changeset
|
1441 call timer_start(100, function('s:CheckSize')) |
26468
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1442 call feedkeys('a', 'tx!') |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1443 call assert_equal(1, winheight(0)) |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1444 bwipe! |
26520
bea106f5fd26
patch 8.2.3789: Test_window_minimal_size can fail on a slow machine
Bram Moolenaar <Bram@vim.org>
parents:
26468
diff
changeset
|
1445 delfunc s:CheckSize |
26468
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1446 endif |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1447 |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1448 set winminwidth& winminheight& |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1449 endfunc |
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1450 |
27047
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1451 func Test_win_move_separator() |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1452 edit a |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1453 leftabove vsplit b |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1454 let w = winwidth(0) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1455 " check win_move_separator from left window on left window |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1456 call assert_equal(1, winnr()) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1457 for offset in range(5) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1458 call assert_true(win_move_separator(0, offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1459 call assert_equal(w + offset, winwidth(0)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1460 call assert_true(0->win_move_separator(-offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1461 call assert_equal(w, winwidth(0)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1462 endfor |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1463 " check win_move_separator from right window on left window number |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1464 wincmd l |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1465 call assert_notequal(1, winnr()) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1466 for offset in range(5) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1467 call assert_true(1->win_move_separator(offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1468 call assert_equal(w + offset, winwidth(1)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1469 call assert_true(win_move_separator(1, -offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1470 call assert_equal(w, winwidth(1)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1471 endfor |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1472 " check win_move_separator from right window on left window ID |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1473 let id = win_getid(1) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1474 for offset in range(5) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1475 call assert_true(win_move_separator(id, offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1476 call assert_equal(w + offset, winwidth(id)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1477 call assert_true(id->win_move_separator(-offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1478 call assert_equal(w, winwidth(id)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1479 endfor |
27440
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1480 " check win_move_separator from right window on right window is no-op |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1481 let w0 = winwidth(0) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1482 call assert_true(win_move_separator(0, 1)) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1483 call assert_equal(w0, winwidth(0)) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1484 call assert_true(win_move_separator(0, -1)) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1485 call assert_equal(w0, winwidth(0)) |
30978
1b194361b71a
patch 9.0.0824: crash when using win_move_separator() in other tab page
Bram Moolenaar <Bram@vim.org>
parents:
30972
diff
changeset
|
1486 |
27047
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1487 " check that win_move_separator doesn't error with offsets beyond moving |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1488 " possibility |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1489 call assert_true(win_move_separator(id, 5000)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1490 call assert_true(winwidth(id) > w) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1491 call assert_true(win_move_separator(id, -5000)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1492 call assert_true(winwidth(id) < w) |
30978
1b194361b71a
patch 9.0.0824: crash when using win_move_separator() in other tab page
Bram Moolenaar <Bram@vim.org>
parents:
30972
diff
changeset
|
1493 |
27047
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1494 " check that win_move_separator returns false for an invalid window |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1495 wincmd = |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1496 let w = winwidth(0) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1497 call assert_false(win_move_separator(-1, 1)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1498 call assert_equal(w, winwidth(0)) |
30978
1b194361b71a
patch 9.0.0824: crash when using win_move_separator() in other tab page
Bram Moolenaar <Bram@vim.org>
parents:
30972
diff
changeset
|
1499 |
27047
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1500 " check that win_move_separator returns false for a popup window |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1501 let id = popup_create(['hello', 'world'], {}) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1502 let w = winwidth(id) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1503 call assert_false(win_move_separator(id, 1)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1504 call assert_equal(w, winwidth(id)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1505 call popup_close(id) |
30978
1b194361b71a
patch 9.0.0824: crash when using win_move_separator() in other tab page
Bram Moolenaar <Bram@vim.org>
parents:
30972
diff
changeset
|
1506 |
1b194361b71a
patch 9.0.0824: crash when using win_move_separator() in other tab page
Bram Moolenaar <Bram@vim.org>
parents:
30972
diff
changeset
|
1507 " check that using another tabpage fails without crash |
1b194361b71a
patch 9.0.0824: crash when using win_move_separator() in other tab page
Bram Moolenaar <Bram@vim.org>
parents:
30972
diff
changeset
|
1508 let id = win_getid() |
1b194361b71a
patch 9.0.0824: crash when using win_move_separator() in other tab page
Bram Moolenaar <Bram@vim.org>
parents:
30972
diff
changeset
|
1509 tabnew |
1b194361b71a
patch 9.0.0824: crash when using win_move_separator() in other tab page
Bram Moolenaar <Bram@vim.org>
parents:
30972
diff
changeset
|
1510 call assert_fails('call win_move_separator(id, -1)', 'E1308:') |
1b194361b71a
patch 9.0.0824: crash when using win_move_separator() in other tab page
Bram Moolenaar <Bram@vim.org>
parents:
30972
diff
changeset
|
1511 tabclose |
1b194361b71a
patch 9.0.0824: crash when using win_move_separator() in other tab page
Bram Moolenaar <Bram@vim.org>
parents:
30972
diff
changeset
|
1512 |
27047
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1513 %bwipe! |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1514 endfunc |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1515 |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1516 func Test_win_move_statusline() |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1517 edit a |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1518 leftabove split b |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1519 let h = winheight(0) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1520 " check win_move_statusline from top window on top window |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1521 call assert_equal(1, winnr()) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1522 for offset in range(5) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1523 call assert_true(win_move_statusline(0, offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1524 call assert_equal(h + offset, winheight(0)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1525 call assert_true(0->win_move_statusline(-offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1526 call assert_equal(h, winheight(0)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1527 endfor |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1528 " check win_move_statusline from bottom window on top window number |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1529 wincmd j |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1530 call assert_notequal(1, winnr()) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1531 for offset in range(5) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1532 call assert_true(1->win_move_statusline(offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1533 call assert_equal(h + offset, winheight(1)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1534 call assert_true(win_move_statusline(1, -offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1535 call assert_equal(h, winheight(1)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1536 endfor |
27440
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1537 " check win_move_statusline from bottom window on bottom window |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1538 let h0 = winheight(0) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1539 for offset in range(5) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1540 call assert_true(0->win_move_statusline(-offset)) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1541 call assert_equal(h0 - offset, winheight(0)) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1542 call assert_equal(1 + offset, &cmdheight) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1543 call assert_true(win_move_statusline(0, offset)) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1544 call assert_equal(h0, winheight(0)) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1545 call assert_equal(1, &cmdheight) |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1546 endfor |
1118a65c9bc7
patch 8.2.4248: no proper test for moving the window separator
Bram Moolenaar <Bram@vim.org>
parents:
27047
diff
changeset
|
1547 call assert_true(win_move_statusline(0, 1)) |
30005
bb0e525e1393
patch 9.0.0340: the 'cmdheight' zero support causes too much trouble
Bram Moolenaar <Bram@vim.org>
parents:
29994
diff
changeset
|
1548 call assert_equal(h0, winheight(0)) |
bb0e525e1393
patch 9.0.0340: the 'cmdheight' zero support causes too much trouble
Bram Moolenaar <Bram@vim.org>
parents:
29994
diff
changeset
|
1549 call assert_equal(1, &cmdheight) |
27047
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1550 " check win_move_statusline from bottom window on top window ID |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1551 let id = win_getid(1) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1552 for offset in range(5) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1553 call assert_true(win_move_statusline(id, offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1554 call assert_equal(h + offset, winheight(id)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1555 call assert_true(id->win_move_statusline(-offset)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1556 call assert_equal(h, winheight(id)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1557 endfor |
30972
62a42d860d87
patch 9.0.0820: memory leak with empty shell command
Bram Moolenaar <Bram@vim.org>
parents:
30869
diff
changeset
|
1558 |
27047
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1559 " check that win_move_statusline doesn't error with offsets beyond moving |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1560 " possibility |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1561 call assert_true(win_move_statusline(id, 5000)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1562 call assert_true(winheight(id) > h) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1563 call assert_true(win_move_statusline(id, -5000)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1564 call assert_true(winheight(id) < h) |
30972
62a42d860d87
patch 9.0.0820: memory leak with empty shell command
Bram Moolenaar <Bram@vim.org>
parents:
30869
diff
changeset
|
1565 |
27047
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1566 " check that win_move_statusline returns false for an invalid window |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1567 wincmd = |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1568 let h = winheight(0) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1569 call assert_false(win_move_statusline(-1, 1)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1570 call assert_equal(h, winheight(0)) |
30972
62a42d860d87
patch 9.0.0820: memory leak with empty shell command
Bram Moolenaar <Bram@vim.org>
parents:
30869
diff
changeset
|
1571 |
27047
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1572 " check that win_move_statusline returns false for a popup window |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1573 let id = popup_create(['hello', 'world'], {}) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1574 let h = winheight(id) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1575 call assert_false(win_move_statusline(id, 1)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1576 call assert_equal(h, winheight(id)) |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1577 call popup_close(id) |
30972
62a42d860d87
patch 9.0.0820: memory leak with empty shell command
Bram Moolenaar <Bram@vim.org>
parents:
30869
diff
changeset
|
1578 |
62a42d860d87
patch 9.0.0820: memory leak with empty shell command
Bram Moolenaar <Bram@vim.org>
parents:
30869
diff
changeset
|
1579 " check that using another tabpage fails without crash |
62a42d860d87
patch 9.0.0820: memory leak with empty shell command
Bram Moolenaar <Bram@vim.org>
parents:
30869
diff
changeset
|
1580 let id = win_getid() |
62a42d860d87
patch 9.0.0820: memory leak with empty shell command
Bram Moolenaar <Bram@vim.org>
parents:
30869
diff
changeset
|
1581 tabnew |
62a42d860d87
patch 9.0.0820: memory leak with empty shell command
Bram Moolenaar <Bram@vim.org>
parents:
30869
diff
changeset
|
1582 call assert_fails('call win_move_statusline(id, -1)', 'E1308:') |
62a42d860d87
patch 9.0.0820: memory leak with empty shell command
Bram Moolenaar <Bram@vim.org>
parents:
30869
diff
changeset
|
1583 tabclose |
62a42d860d87
patch 9.0.0820: memory leak with empty shell command
Bram Moolenaar <Bram@vim.org>
parents:
30869
diff
changeset
|
1584 |
27047
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1585 %bwipe! |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1586 endfunc |
b94cdb5ef20e
patch 8.2.4052: not easy to resize a window from a plugin
Bram Moolenaar <Bram@vim.org>
parents:
26520
diff
changeset
|
1587 |
28289
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1588 " Test for window allocation failure |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1589 func Test_window_alloc_failure() |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1590 %bw! |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1591 |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1592 " test for creating a new window above current window |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1593 call test_alloc_fail(GetAllocId('newwin_wvars'), 0, 0) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1594 call assert_fails('above new', 'E342:') |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1595 call assert_equal(1, winnr('$')) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1596 |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1597 " test for creating a new window below current window |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1598 call test_alloc_fail(GetAllocId('newwin_wvars'), 0, 0) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1599 call assert_fails('below new', 'E342:') |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1600 call assert_equal(1, winnr('$')) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1601 |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1602 " test for popup window creation failure |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1603 call test_alloc_fail(GetAllocId('newwin_wvars'), 0, 0) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1604 call assert_fails('call popup_create("Hello", {})', 'E342:') |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1605 call assert_equal([], popup_list()) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1606 |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1607 call test_alloc_fail(GetAllocId('newwin_wvars'), 0, 0) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1608 call assert_fails('split', 'E342:') |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1609 call assert_equal(1, winnr('$')) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1610 |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1611 edit Xwaffile1 |
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1612 edit Xwaffile2 |
28289
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1613 call test_alloc_fail(GetAllocId('newwin_wvars'), 0, 0) |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1614 call assert_fails('sb Xwaffile1', 'E342:') |
28289
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1615 call assert_equal(1, winnr('$')) |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
30009
diff
changeset
|
1616 call assert_equal('Xwaffile2', @%) |
28289
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1617 %bw! |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1618 |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1619 " FIXME: The following test crashes Vim |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1620 " test for new tabpage creation failure |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1621 " call test_alloc_fail(GetAllocId('newwin_wvars'), 0, 0) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1622 " call assert_fails('tabnew', 'E342:') |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1623 " call assert_equal(1, tabpagenr('$')) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1624 " call assert_equal(1, winnr('$')) |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1625 |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1626 " This test messes up the internal Vim window/frame information. So the |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1627 " Test_window_cmd_cmdwin_with_vsp() test fails after running this test. |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1628 " Open a new tab and close everything else to fix this issue. |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1629 tabnew |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1630 tabonly |
cdaff4db7760
patch 8.2.4670: memory allocation failures for new tab page not tested
Bram Moolenaar <Bram@vim.org>
parents:
27440
diff
changeset
|
1631 endfunc |
26468
2fc13817b100
patch 8.2.3764: cannot see any text when window was made zero lines
Bram Moolenaar <Bram@vim.org>
parents:
24882
diff
changeset
|
1632 |
30134
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1633 func Test_win_equal_last_status() |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1634 let save_lines = &lines |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1635 set lines=20 |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1636 set splitbelow |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1637 set laststatus=0 |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1638 |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1639 split | split | quit |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1640 call assert_equal(winheight(1), winheight(2)) |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1641 |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1642 let &lines = save_lines |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1643 set splitbelow& |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1644 set laststatus& |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1645 endfunc |
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1646 |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1647 " Test "screen" and "cursor" values for 'splitkeep' with a sequence of |
30339
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1648 " split operations for various options: with and without a winbar, |
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1649 " tabline, for each possible value of 'laststatus', 'scrolloff', |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1650 " 'equalalways', and with the cursor at the top, middle and bottom. |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1651 func Test_splitkeep_options() |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1652 " disallow window resizing |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1653 let save_WS = &t_WS |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1654 set t_WS= |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1655 |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1656 let gui = has("gui_running") |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1657 inoremap <expr> c "<cmd>copen<bar>wincmd k<CR>" |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1658 for run in range(0, 20) |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1659 let &splitkeep = run > 10 ? 'topline' : 'screen' |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1660 let &scrolloff = (!(run % 4) ? 0 : run) |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1661 let &laststatus = (run % 3) |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1662 let &splitbelow = (run % 3) |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1663 let &equalalways = (run % 2) |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1664 let wsb = (run % 2) && &splitbelow |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1665 let tl = (gui ? 0 : ((run % 5) ? 1 : 0)) |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1666 let pos = !(run % 3) ? 'H' : ((run % 2) ? 'M' : 'L') |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1667 tabnew | tabonly! | redraw |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1668 execute (run % 5) ? 'tabnew' : '' |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1669 execute (run % 2) ? 'nnoremenu 1.10 WinBar.Test :echo' : '' |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1670 call setline(1, range(1, 256)) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1671 " No scroll for restore_snapshot |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1672 norm G |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1673 try |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1674 copen | close | colder |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1675 catch /E380/ |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1676 endtry |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1677 call assert_equal(257 - winheight(0), line("w0")) |
30239
91ecee475811
patch 9.0.0455: a few problems with 'splitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30219
diff
changeset
|
1678 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1679 " No scroll for firstwin horizontal split |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1680 execute 'norm gg' . pos |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1681 split | redraw | wincmd k |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1682 call assert_equal(1, line("w0")) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1683 call assert_equal(&scroll, winheight(0) / 2) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1684 wincmd j |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1685 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1686 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1687 " No scroll when resizing windows |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1688 wincmd k | resize +2 | redraw |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1689 call assert_equal(1, line("w0")) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1690 wincmd j |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1691 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1692 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1693 " No scroll when dragging statusline |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1694 call win_move_statusline(1, -3) |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1695 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1696 wincmd k |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1697 call assert_equal(1, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1698 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1699 " No scroll when changing shellsize |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1700 set lines+=2 |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1701 call assert_equal(1, line("w0")) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1702 wincmd j |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1703 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1704 set lines-=2 |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1705 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1706 wincmd k |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1707 call assert_equal(1, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1708 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1709 " No scroll when equalizing windows |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1710 wincmd = |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1711 call assert_equal(1, line("w0")) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1712 wincmd j |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1713 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1714 wincmd k |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1715 call assert_equal(1, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1716 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1717 " No scroll in windows split multiple times |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1718 vsplit | split | 4wincmd w |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1719 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1720 1wincmd w | quit | wincmd l | split |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1721 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1722 wincmd j |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1723 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1724 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1725 " No scroll in small window |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1726 2wincmd w | only | 5split | wincmd k |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1727 call assert_equal(1, line("w0")) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1728 wincmd j |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1729 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1730 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1731 " No scroll for vertical split |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1732 quit | vsplit | wincmd l |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1733 call assert_equal(1, line("w0")) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1734 wincmd h |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1735 call assert_equal(1, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1736 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1737 " No scroll in windows split and quit multiple times |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1738 quit | redraw | split | split | quit | redraw |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1739 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1740 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1741 " No scroll for new buffer |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1742 1wincmd w | only | copen | wincmd k |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1743 call assert_equal(1, line("w0")) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1744 only |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1745 call assert_equal(1, line("w0")) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1746 above copen | wincmd j |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1747 call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1748 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1749 " No scroll when opening cmdwin, and no cursor move when closing cmdwin. |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1750 only | norm ggL |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1751 let curpos = getcurpos() |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1752 norm q: |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1753 call assert_equal(1, line("w0")) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1754 call assert_equal(curpos, getcurpos()) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1755 |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1756 " Scroll when cursor becomes invalid in insert mode |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1757 norm Lic |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1758 call assert_equal(curpos, getcurpos()) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1759 |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1760 " No scroll when topline not equal to 1 |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1761 only | execute "norm gg5\<C-e>" | split | wincmd k |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1762 call assert_equal(6, line("w0")) |
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1763 wincmd j |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1764 call assert_equal(&spk == 'topline' ? 6 : 5 + win_screenpos(0)[0] - tl - wsb, line("w0")) |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1765 endfor |
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1766 |
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1767 tabnew | tabonly! | %bwipeout! |
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1768 iunmap c |
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1769 set scrolloff& |
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1770 set splitbelow& |
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1771 set laststatus& |
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1772 set equalalways& |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1773 set splitkeep& |
30285
9edb1a8161ac
patch 9.0.0478: test for 'splitscroll' takes too much time
Bram Moolenaar <Bram@vim.org>
parents:
30271
diff
changeset
|
1774 let &t_WS = save_WS |
30219
bc8ad1c28b51
patch 9.0.0445: when opening/closing window text moves up/down
Bram Moolenaar <Bram@vim.org>
parents:
30134
diff
changeset
|
1775 endfunc |
30134
0211a930d873
patch 9.0.0403: 'equalalways' may be off when 'laststatus' is zero
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
1776 |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1777 function Test_splitkeep_cmdwin_cursor_position() |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1778 set splitkeep=screen |
30271
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1779 call setline(1, range(&lines)) |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1780 |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1781 " No scroll when cursor is at near bottom of window and cusor position |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1782 " recompution (done by line('w0') in this test) happens while in cmdwin. |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1783 normal! G |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1784 let firstline = line('w0') |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1785 autocmd CmdwinEnter * ++once autocmd WinEnter * ++once call line('w0') |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1786 execute "normal! q:\<C-w>q" |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1787 redraw! |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1788 call assert_equal(firstline, line('w0')) |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1789 |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1790 " User script can change cursor position successfully while in cmdwin and it |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1791 " shouldn't be changed when closing cmdwin. |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1792 execute "normal! Gq:\<Cmd>call win_execute(winnr('#')->win_getid(), 'call cursor(1, 1)')\<CR>\<C-w>q" |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1793 call assert_equal(1, line('.')) |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1794 call assert_equal(1, col('.')) |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1795 |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1796 execute "normal! Gq:\<Cmd>autocmd WinEnter * ++once call cursor(1, 1)\<CR>\<C-w>q" |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1797 call assert_equal(1, line('.')) |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1798 call assert_equal(1, col('.')) |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1799 |
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1800 %bwipeout! |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1801 set splitkeep& |
30271
d8f04df5b917
patch 9.0.0471: no test for what patch 9.0.0469 fixes
Bram Moolenaar <Bram@vim.org>
parents:
30259
diff
changeset
|
1802 endfunction |
30300
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1803 |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1804 function Test_splitkeep_misc() |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1805 set splitkeep=screen |
30339
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1806 set splitbelow |
30300
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1807 |
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1808 call setline(1, range(1, &lines)) |
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1809 norm Gzz |
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1810 let top = line('w0') |
30339
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1811 " No scroll when aucmd_win is opened |
30300
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1812 call setbufvar(bufnr("test", 1) , '&buftype', 'nofile') |
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1813 call assert_equal(top, line('w0')) |
30339
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1814 " No scroll when tab is changed/closed |
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1815 tab help | close |
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1816 call assert_equal(top, line('w0')) |
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1817 " No scroll when help is closed and buffer line count < window height |
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1818 norm ggdG |
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1819 call setline(1, range(1, &lines - 10)) |
30300
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1820 norm G |
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1821 let top = line('w0') |
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1822 help | quit |
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1823 call assert_equal(top, line('w0')) |
30665
fe0a18141c3c
patch 9.0.0667: ml_get error when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1824 " No error when resizing window in autocmd and buffer length changed |
fe0a18141c3c
patch 9.0.0667: ml_get error when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1825 autocmd FileType qf exe "resize" line('$') |
fe0a18141c3c
patch 9.0.0667: ml_get error when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1826 cexpr getline(1, '$') |
fe0a18141c3c
patch 9.0.0667: ml_get error when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1827 copen |
fe0a18141c3c
patch 9.0.0667: ml_get error when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1828 wincmd p |
fe0a18141c3c
patch 9.0.0667: ml_get error when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1829 norm dd |
fe0a18141c3c
patch 9.0.0667: ml_get error when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30657
diff
changeset
|
1830 cexpr getline(1, '$') |
30300
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1831 |
30339
b5f67135fcb6
patch 9.0.0505: various problems with 'nosplitscroll'
Bram Moolenaar <Bram@vim.org>
parents:
30300
diff
changeset
|
1832 %bwipeout! |
30300
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1833 set splitbelow& |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1834 set splitkeep& |
30300
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1835 endfunc |
b9d07900b0b8
patch 9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help
Bram Moolenaar <Bram@vim.org>
parents:
30285
diff
changeset
|
1836 |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1837 function Test_splitkeep_callback() |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1838 CheckScreendump |
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1839 let lines =<< trim END |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1840 set splitkeep=screen |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1841 call setline(1, range(&lines)) |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1842 function C1(a, b) |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1843 split | wincmd p |
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1844 endfunction |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1845 function C2(a, b) |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1846 close | split |
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1847 endfunction |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1848 nn j <cmd>call job_start([&sh, &shcf, "true"], { 'exit_cb': 'C1' })<CR> |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1849 nn t <cmd>call popup_create(term_start([&sh, &shcf, "true"], |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1850 \ { 'hidden': 1, 'exit_cb': 'C2' }), {})<CR> |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1851 END |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1852 call writefile(lines, 'XTestSplitkeepCallback', 'D') |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1853 let buf = RunVimInTerminal('-S XTestSplitkeepCallback', #{rows: 8}) |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1854 |
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1855 call term_sendkeys(buf, "j") |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1856 call VerifyScreenDump(buf, 'Test_splitkeep_callback_1', {}) |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1857 |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1858 call term_sendkeys(buf, ":quit\<CR>Ht") |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1859 call VerifyScreenDump(buf, 'Test_splitkeep_callback_2', {}) |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1860 |
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1861 call term_sendkeys(buf, ":set sb\<CR>:quit\<CR>Gj") |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1862 call VerifyScreenDump(buf, 'Test_splitkeep_callback_3', {}) |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1863 |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1864 call term_sendkeys(buf, ":quit\<CR>Gt") |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1865 call VerifyScreenDump(buf, 'Test_splitkeep_callback_4', {}) |
30439
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1866 endfunc |
e3091fc473a1
patch 9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin
Bram Moolenaar <Bram@vim.org>
parents:
30339
diff
changeset
|
1867 |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1868 function Test_splitkeep_fold() |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1869 CheckScreendump |
30535
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1870 |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1871 let lines =<< trim END |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1872 set splitkeep=screen |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1873 set foldmethod=marker |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1874 set number |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1875 let line = 1 |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1876 for n in range(1, &lines) |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1877 call setline(line, ['int FuncName() {/*{{{*/', 1, 2, 3, 4, 5, '}/*}}}*/', |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1878 \ 'after fold']) |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1879 let line += 8 |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1880 endfor |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1881 END |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1882 call writefile(lines, 'XTestSplitkeepFold', 'D') |
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1883 let buf = RunVimInTerminal('-S XTestSplitkeepFold', #{rows: 10}) |
30535
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1884 |
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1885 call term_sendkeys(buf, "L:wincmd s\<CR>") |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1886 call VerifyScreenDump(buf, 'Test_splitkeep_fold_1', {}) |
30535
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1887 |
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1888 call term_sendkeys(buf, ":quit\<CR>") |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1889 call VerifyScreenDump(buf, 'Test_splitkeep_fold_2', {}) |
30535
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1890 |
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1891 call term_sendkeys(buf, "H:below split\<CR>") |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1892 call VerifyScreenDump(buf, 'Test_splitkeep_fold_3', {}) |
30535
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1893 |
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1894 call term_sendkeys(buf, ":wincmd k\<CR>:quit\<CR>") |
30624
f2f35161d75a
patch 9.0.0647: the 'splitscroll' option is not a good name
Bram Moolenaar <Bram@vim.org>
parents:
30535
diff
changeset
|
1895 call VerifyScreenDump(buf, 'Test_splitkeep_fold_4', {}) |
30535
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1896 endfunction |
04df44c52d65
patch 9.0.0603: with 'nosplitscroll' folds are not handled correctly
Bram Moolenaar <Bram@vim.org>
parents:
30439
diff
changeset
|
1897 |
31261
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1898 function Test_splitkeep_status() |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1899 CheckScreendump |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1900 |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1901 let lines =<< trim END |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1902 call setline(1, ['a', 'b', 'c']) |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1903 set nomodified |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1904 set splitkeep=screen |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1905 let win = winnr() |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1906 wincmd s |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1907 wincmd j |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1908 END |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1909 call writefile(lines, 'XTestSplitkeepStatus', 'D') |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1910 let buf = RunVimInTerminal('-S XTestSplitkeepStatus', #{rows: 10}) |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1911 |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1912 call term_sendkeys(buf, ":call win_move_statusline(win, 1)\<CR>") |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1913 call VerifyScreenDump(buf, 'Test_splitkeep_status_1', {}) |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1914 endfunction |
a9040128bc3b
patch 9.0.0964: status line not redrawn when 'splitkeep' is "screen"
Bram Moolenaar <Bram@vim.org>
parents:
30986
diff
changeset
|
1915 |
9909
3ee84d270ea7
commit https://github.com/vim/vim/commit/9e4d8215d386100ab660d7d11e6620fd148b605e
Christian Brabandt <cb@256bit.org>
parents:
9349
diff
changeset
|
1916 " vim: shiftwidth=2 sts=2 expandtab |