diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-25 21:59:33 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-26 07:27:50 -0400 |
commit | f60af8694b5fd7339e3b9883f6bc5be34852fd14 (patch) | |
tree | 4cab97c1a3ffc974d79afc01f4e7b6bb60dbc846 /runtime/doc/eval.txt | |
parent | 08aa9b00237ab45dadeffdf381e0e3c228337e53 (diff) | |
download | rneovim-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 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 7682a1a584..32783f0851 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2377,6 +2377,7 @@ win_screenpos({nr}) List get screen position of window {nr} winbufnr({nr}) Number buffer number of window {nr} wincol() Number window column of the cursor winheight({nr}) Number height of window {nr} +winlayout([{tabnr}]) List layout of windows in tab {tabnr} winline() Number window line of the cursor winnr([{expr}]) Number number of current window winrestcmd() String returns command to restore window sizes @@ -8538,6 +8539,35 @@ winheight({nr}) *winheight()* Examples: > :echo "The current window has " . winheight(0) . " lines." < +winlayout([{tabnr}]) *winlayout()* + The result is a nested List containing the layout of windows + in a tabpage. + + Without {tabnr} use the current tabpage, otherwise the tabpage + with number {tabnr}. If the tabpage {tabnr} is not found, + returns an empty list. + + For a leaf window, it returns: + ['leaf', {winid}] + For horizontally split windows, which form a column, it + returns: + ['col', [{nested list of windows}]] + For vertically split windows, which form a row, it returns: + ['row', [{nested list of windows}]] + + Example: > + " Only one window in the tab page + :echo winlayout() + ['leaf', 1000] + " Two horizontally split windows + :echo winlayout() + ['col', [['leaf', 1000], ['leaf', 1001]]] + " Three horizontally split windows, with two + " vertically split windows in the middle window + :echo winlayout(2) + ['col', [['leaf', 1002], ['row', ['leaf', 1003], + ['leaf', 1001]]], ['leaf', 1000]] +< *winline()* winline() The result is a Number, which is the screen line of the cursor in the window. This is counting screen lines from the top of |