0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.1.2013: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
This commit is contained in:
Bram Moolenaar
2019-09-08 21:51:41 +02:00
parent 7ee80f7661
commit f92e58cadb
11 changed files with 145 additions and 49 deletions

View File

@@ -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