aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-25 21:59:33 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-26 07:27:50 -0400
commitf60af8694b5fd7339e3b9883f6bc5be34852fd14 (patch)
tree4cab97c1a3ffc974d79afc01f4e7b6bb60dbc846 /src/nvim/testdir
parent08aa9b00237ab45dadeffdf381e0e3c228337e53 (diff)
downloadrneovim-f60af8694b5fd7339e3b9883f6bc5be34852fd14.tar.gz
rneovim-f60af8694b5fd7339e3b9883f6bc5be34852fd14.tar.bz2
rneovim-f60af8694b5fd7339e3b9883f6bc5be34852fd14.zip
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
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_window_id.vim20
1 files changed, 20 insertions, 0 deletions
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