diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-09-08 21:51:41 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-09-08 21:51:41 +0200 |
commit | f92e58cadb03156879e9bdbf6341bf662d9c87cc (patch) | |
tree | 13bdd750b1d0c9db7f2267d2300eba24f6560619 /src/testdir/test_window_cmd.vim | |
parent | 7ee80f766130f22598c928415c92ec612a8f18cf (diff) | |
download | vim-git-f92e58cadb03156879e9bdbf6341bf662d9c87cc.tar.gz |
patch 8.1.2013: more functions can be used as methodsv8.1.2013
Problem: More functions can be used as methods.
Solution: Make various functions usable as a method.
Diffstat (limited to 'src/testdir/test_window_cmd.vim')
-rw-r--r-- | src/testdir/test_window_cmd.vim | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index f2a9f1797..9bdae2c68 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -72,7 +72,7 @@ endfunc func Test_window_quit() e Xa split Xb - call assert_equal(2, winnr('$')) + call assert_equal(2, '$'->winnr()) call assert_equal('Xb', bufname(winbufnr(1))) call assert_equal('Xa', bufname(winbufnr(2))) @@ -88,7 +88,7 @@ func Test_window_horizontal_split() 3wincmd s call assert_equal(2, winnr('$')) call assert_equal(3, winheight(0)) - call assert_equal(winwidth(1), winwidth(2)) + call assert_equal(winwidth(1), 2->winwidth()) call assert_fails('botright topleft wincmd s', 'E442:') bw @@ -300,7 +300,7 @@ func Test_window_height() wincmd + call assert_equal(wh1, winheight(1)) - call assert_equal(wh2, winheight(2)) + call assert_equal(wh2, 2->winheight()) 2wincmd _ call assert_equal(2, winheight(1)) @@ -845,4 +845,16 @@ func Test_winnr() only | tabonly endfunc +func Test_winrestview() + split runtest.vim + normal 50% + let view = winsaveview() + close + split runtest.vim + eval view->winrestview() + call assert_equal(view, winsaveview()) + + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |