Mercurial > vim
comparison runtime/doc/eval.txt @ 14587:d33220d3bc27 v8.1.0307
patch 8.1.0307: there is no good way to get the window layout
commit https://github.com/vim/vim/commit/0f6b4f06dece71487a6d8546c50de775d9c8c287
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 21 16:56:34 2018 +0200
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 21 Aug 2018 17:00:06 +0200 |
parents | 5c5908e81e93 |
children | 72d6f6f7ead7 |
comparison
equal
deleted
inserted
replaced
14586:48e507fdb82a | 14587:d33220d3bc27 |
---|---|
2495 win_id2win({expr}) Number get window nr from window ID | 2495 win_id2win({expr}) Number get window nr from window ID |
2496 win_screenpos({nr}) List get screen position of window {nr} | 2496 win_screenpos({nr}) List get screen position of window {nr} |
2497 winbufnr({nr}) Number buffer number of window {nr} | 2497 winbufnr({nr}) Number buffer number of window {nr} |
2498 wincol() Number window column of the cursor | 2498 wincol() Number window column of the cursor |
2499 winheight({nr}) Number height of window {nr} | 2499 winheight({nr}) Number height of window {nr} |
2500 winlayout([{tabnr}]) List layout of windows in tab {tabnr} | |
2500 winline() Number window line of the cursor | 2501 winline() Number window line of the cursor |
2501 winnr([{expr}]) Number number of current window | 2502 winnr([{expr}]) Number number of current window |
2502 winrestcmd() String returns command to restore window sizes | 2503 winrestcmd() String returns command to restore window sizes |
2503 winrestview({dict}) none restore view of current window | 2504 winrestview({dict}) none restore view of current window |
2504 winsaveview() Dict save view of current window | 2505 winsaveview() Dict save view of current window |
9085 returned. When window {nr} doesn't exist, -1 is returned. | 9086 returned. When window {nr} doesn't exist, -1 is returned. |
9086 An existing window always has a height of zero or more. | 9087 An existing window always has a height of zero or more. |
9087 This excludes any window toolbar line. | 9088 This excludes any window toolbar line. |
9088 Examples: > | 9089 Examples: > |
9089 :echo "The current window has " . winheight(0) . " lines." | 9090 :echo "The current window has " . winheight(0) . " lines." |
9091 < | |
9092 winlayout([{tabnr}]) *winlayout()* | |
9093 The result is a nested List containing the layout of windows | |
9094 in a tabpage. | |
9095 | |
9096 Without {tabnr} use the current tabpage, otherwise the tabpage | |
9097 with number {tabnr}. If the tabpage {tabnr} is not found, | |
9098 returns an empty list. | |
9099 | |
9100 For a leaf window, it returns: | |
9101 ['leaf', {winid}] | |
9102 For horizontally split windows, which form a column, it | |
9103 returns: | |
9104 ['col', [{nested list of windows}]] | |
9105 For vertically split windows, which form a row, it returns: | |
9106 ['row', [{nested list of windows}]] | |
9107 | |
9108 Example: > | |
9109 " Only one window in the tab page | |
9110 :echo winlayout() | |
9111 ['leaf', 1000] | |
9112 " Two horizontally split windows | |
9113 :echo winlayout() | |
9114 ['col', [['leaf', 1000], ['leaf', 1001]]] | |
9115 " Three horizontally split windows, with two | |
9116 " vertically split windows in the middle window | |
9117 :echo winlayout(2) | |
9118 ['col', [['leaf', 1002], ['row', ['leaf', 1003], | |
9119 ['leaf', 1001]]], ['leaf', 1000]] | |
9090 < | 9120 < |
9091 *winline()* | 9121 *winline()* |
9092 winline() The result is a Number, which is the screen line of the cursor | 9122 winline() The result is a Number, which is the screen line of the cursor |
9093 in the window. This is counting screen lines from the top of | 9123 in the window. This is counting screen lines from the top of |
9094 the window. The first line is one. | 9124 the window. The first line is one. |