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

patch 8.1.2011: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.  Make the window
            command test faster.
This commit is contained in:
Bram Moolenaar
2019-09-08 18:58:44 +02:00
parent 9490b9a61c
commit ce90e36f59
15 changed files with 110 additions and 79 deletions

View File

@@ -485,7 +485,7 @@ func Test_window_newtab()
wincmd T
call assert_equal(2, tabpagenr('$'))
call assert_equal(['Xb', 'Xa'], map(tabpagebuflist(1), 'bufname(v:val)'))
call assert_equal(['Xc' ], map(tabpagebuflist(2), 'bufname(v:val)'))
call assert_equal(['Xc' ], map(2->tabpagebuflist(), 'bufname(v:val)'))
%bw!
endfunc
@@ -598,8 +598,11 @@ endfunc
func Fun_RenewFile()
" Need to wait a bit for the timestamp to be older.
sleep 2
silent execute '!echo "1" > tmp.txt'
let old_ftime = getftime("tmp.txt")
while getftime("tmp.txt") == old_ftime
sleep 100m
silent execute '!echo "1" > tmp.txt'
endwhile
sp
wincmd p
edit! tmp.txt
@@ -835,7 +838,7 @@ func Test_winnr()
tabnew
call assert_equal(8, tabpagewinnr(1, 'j'))
call assert_equal(2, tabpagewinnr(1, 'k'))
call assert_equal(2, 1->tabpagewinnr('k'))
call assert_equal(4, tabpagewinnr(1, 'h'))
call assert_equal(6, tabpagewinnr(1, 'l'))