diff options
author | Marco Hinz <mh.codebro+github@gmail.com> | 2019-04-10 10:16:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-10 10:16:32 +0200 |
commit | 21b108fe445452e6e35621184fc77623dc64f9a3 (patch) | |
tree | 8e861512afe04e03aee45fdd7a3129e8cd694d7b /runtime | |
parent | ddd0eb6f5120a09b97867d2561ea61309038ccd2 (diff) | |
download | rneovim-21b108fe445452e6e35621184fc77623dc64f9a3.tar.gz rneovim-21b108fe445452e6e35621184fc77623dc64f9a3.tar.bz2 rneovim-21b108fe445452e6e35621184fc77623dc64f9a3.zip |
vim-patch:8.1.1140: not easy to find out what neighbors a window has (#9873)
Problem: Not easy to find out what neighbors a window has.
Solution: Add more arguments to winnr(). (Yegappan Lakshmanan)
https://github.com/vim/vim/commit/46ad288b9b2a6eb0430cf802ff5ce68a58629897
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 8c81f35331..a7dbe294c7 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -8405,17 +8405,30 @@ winline() The result is a Number, which is the screen line of the cursor *winnr()* winnr([{arg}]) The result is a Number, which is the number of the current window. The top window has number 1. - When the optional argument is "$", the number of the - last window is returned (the window count). > - let window_count = winnr('$') -< When the optional argument is "#", the number of the last - accessed window is returned (where |CTRL-W_p| goes to). - If there is no previous window or it is in another tab page 0 - is returned. + + The optional argument {arg} supports the following values: + $ the number of the last window (the window + count). + # the number of the last accessed window (where + |CTRL-W_p| goes to). If there is no previous + window or it is in another tab page 0 is + returned. + {N}j the number of the Nth window below the + current window (where |CTRL-W_j| goes to). + {N}k the number of the Nth window above the current + window (where |CTRL-W_k| goes to). + {N}h the number of the Nth window left of the + current window (where |CTRL-W_h| goes to). + {N}l the number of the Nth window right of the + current window (where |CTRL-W_l| goes to). The number can be used with |CTRL-W_w| and ":wincmd w" |:wincmd|. Also see |tabpagewinnr()| and |win_getid()|. - + Examples: > + let window_count = winnr('$') + let prev_window = winnr('#') + let wnum = winnr('3k') +< *winrestcmd()* winrestcmd() Returns a sequence of |:resize| commands that should restore the current window sizes. Only works properly when no windows |