1
0
forked from aniani/vim

patch 7.4.1893

Problem:    Cannot easily get the window ID for a buffer.
Solution:   Add bufwinid().
This commit is contained in:
Bram Moolenaar
2016-06-04 17:58:52 +02:00
parent c9721bdc63
commit b3619a90ea
3 changed files with 37 additions and 6 deletions

View File

@@ -1862,6 +1862,7 @@ buflisted({expr}) Number TRUE if buffer {expr} is listed
bufloaded({expr}) Number TRUE if buffer {expr} is loaded
bufname({expr}) String Name of the buffer {expr}
bufnr({expr} [, {create}]) Number Number of the buffer {expr}
bufwinid({expr}) Number window ID of buffer {expr}
bufwinnr({expr}) Number window number of buffer {expr}
byte2line({byte}) Number line number at byte count {byte}
byteidx({expr}, {nr}) Number byte index of {nr}'th char in {expr}
@@ -2557,6 +2558,16 @@ bufnr({expr} [, {create}])
*last_buffer_nr()*
Obsolete name for bufnr("$"): last_buffer_nr().
bufwinid({expr}) *bufwinid()*
The result is a Number, which is the window ID of the first
window associated with buffer {expr}. For the use of {expr},
see |bufname()| above. If buffer {expr} doesn't exist or
there is no such window, -1 is returned. Example: >
echo "A window containing buffer 1 is " . (bufwinid(1))
<
Only deals with the current tab page.
bufwinnr({expr}) *bufwinnr()*
The result is a Number, which is the number of the first
window associated with buffer {expr}. For the use of {expr},