diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-13 19:04:51 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-13 19:04:51 +0100 |
commit | 9cdf86b86f5fdb5a45b682f336846f9d9a9c6f1f (patch) | |
tree | 905ddef78df904d3060bd749cf4c073dbeb1de78 /src/testdir | |
parent | 86edef664efccbfe685906c854b9cdd04e56f2d5 (diff) |
patch 7.4.1558v7.4.1558
Problem: It is not easy to find out what windows display a buffer.
Solution: Add win_findbuf().
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_window_id.vim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/testdir/test_window_id.vim b/src/testdir/test_window_id.vim index b9e9f45c49..fa3ebd757e 100644 --- a/src/testdir/test_window_id.vim +++ b/src/testdir/test_window_id.vim @@ -5,6 +5,7 @@ func Test_win_getid() let id1 = win_getid() split two let id2 = win_getid() + let bufnr2 = bufnr('%') split three let id3 = win_getid() tabnew @@ -12,6 +13,7 @@ func Test_win_getid() let id4 = win_getid() split five let id5 = win_getid() + let bufnr5 = bufnr('%') tabnext wincmd w @@ -67,5 +69,11 @@ func Test_win_getid() call assert_equal([1, nr2], win_id2tabwin(id2)) call assert_equal([2, nr4], win_id2tabwin(id4)) + call assert_equal([], win_findbuf(9999)) + call assert_equal([id2], win_findbuf(bufnr2)) + call win_gotoid(id5) + split + call assert_equal(sort([id5, win_getid()]), sort(win_findbuf(bufnr5))) + only! endfunc |