From f60af8694b5fd7339e3b9883f6bc5be34852fd14 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 25 May 2019 21:59:33 -0400 Subject: vim-patch:8.1.0307: there is no good way to get the window layout Problem: There is no good way to get the window layout. Solution: Add the winlayout() function. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/0f6b4f06dece71487a6d8546c50de775d9c8c287 --- src/nvim/testdir/test_window_id.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/nvim/testdir/test_window_id.vim') diff --git a/src/nvim/testdir/test_window_id.vim b/src/nvim/testdir/test_window_id.vim index b3b506d04d..d10d831650 100644 --- a/src/nvim/testdir/test_window_id.vim +++ b/src/nvim/testdir/test_window_id.vim @@ -101,3 +101,23 @@ func Test_win_getid_curtab() call assert_equal(win_getid(1), win_getid(1, 1)) tabclose! endfunc + +func Test_winlayout() + let w1 = win_getid() + call assert_equal(['leaf', w1], winlayout()) + + split + let w2 = win_getid() + call assert_equal(['col', [['leaf', w2], ['leaf', w1]]], winlayout()) + + split + let w3 = win_getid() + call assert_equal(['col', [['leaf', w3], ['leaf', w2], ['leaf', w1]]], winlayout()) + + 2wincmd w + vsplit + let w4 = win_getid() + call assert_equal(['col', [['leaf', w3], ['row', [['leaf', w4], ['leaf', w2]]], ['leaf', w1]]], winlayout()) + + only! +endfunc -- cgit