diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-08-21 16:56:34 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-08-21 16:56:34 +0200 |
commit | 0f6b4f06dece71487a6d8546c50de775d9c8c287 (patch) | |
tree | 4801fcd4f84a5de0bcf7ba0d0dff832a8a192746 /src/testdir/test_window_id.vim | |
parent | da6e8919e75fa8f961d1b805e877c8a92e76dafb (diff) |
patch 8.1.0307: there is no good way to get the window layoutv8.1.0307
Problem: There is no good way to get the window layout.
Solution: Add the winlayout() function. (Yegappan Lakshmanan)
Diffstat (limited to 'src/testdir/test_window_id.vim')
-rw-r--r-- | src/testdir/test_window_id.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_window_id.vim b/src/testdir/test_window_id.vim index b3b506d04d..d10d831650 100644 --- a/src/testdir/test_window_id.vim +++ b/src/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 |