comparison runtime/doc/eval.txt @ 9223:6c4d610fce0a v7.4.1895

commit https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 4 18:49:36 2016 +0200 patch 7.4.1895 Problem: Cannot use a window ID where a window number is expected. Solution: Add LOWEST_WIN_ID, so that the window ID can be used where a number is expected.
author Christian Brabandt <cb@256bit.org>
date Sat, 04 Jun 2016 19:00:06 +0200
parents 17fa362f10be
children 64035abb986b
comparison
equal deleted inserted replaced
9222:f2b4633b95e2 9223:6c4d610fce0a
2328 2328
2329 Without arguments use the current window. 2329 Without arguments use the current window.
2330 With {winnr} only use this window in the current tab page. 2330 With {winnr} only use this window in the current tab page.
2331 With {winnr} and {tabnr} use the window in the specified tab 2331 With {winnr} and {tabnr} use the window in the specified tab
2332 page. 2332 page.
2333 {winnr} can be the window number or the window ID.
2333 2334
2334 *argv()* 2335 *argv()*
2335 argv([{nr}]) The result is the {nr}th file in the argument list of the 2336 argv([{nr}]) The result is the {nr}th file in the argument list of the
2336 current window. See |arglist|. "argv(0)" is the first one. 2337 current window. See |arglist|. "argv(0)" is the first one.
2337 Example: > 2338 Example: >
3985 3986
3986 With {winnr} return the local current directory of this window 3987 With {winnr} return the local current directory of this window
3987 in the current tab page. 3988 in the current tab page.
3988 With {winnr} and {tabnr} return the local current directory of 3989 With {winnr} and {tabnr} return the local current directory of
3989 the window in the specified tab page. 3990 the window in the specified tab page.
3991 {winnr} can be the window number or the window ID.
3990 Return an empty string if the arguments are invalid. 3992 Return an empty string if the arguments are invalid.
3991 3993
3992 getfsize({fname}) *getfsize()* 3994 getfsize({fname}) *getfsize()*
3993 The result is a Number, which is the size in bytes of the 3995 The result is a Number, which is the size in bytes of the
3994 given file {fname}. 3996 given file {fname}.
4081 4083
4082 < To get lines from another buffer see |getbufline()| 4084 < To get lines from another buffer see |getbufline()|
4083 4085
4084 getloclist({nr}) *getloclist()* 4086 getloclist({nr}) *getloclist()*
4085 Returns a list with all the entries in the location list for 4087 Returns a list with all the entries in the location list for
4086 window {nr}. When {nr} is zero the current window is used. 4088 window {nr}. {nr} can be the window number or the window ID.
4089 When {nr} is zero the current window is used.
4090
4087 For a location list window, the displayed location list is 4091 For a location list window, the displayed location list is
4088 returned. For an invalid window number {nr}, an empty list is 4092 returned. For an invalid window number {nr}, an empty list is
4089 returned. Otherwise, same as |getqflist()|. 4093 returned. Otherwise, same as |getqflist()|.
4090 4094
4091 getmatches() *getmatches()* 4095 getmatches() *getmatches()*
4215 When {varname} is empty a dictionary with all window-local 4219 When {varname} is empty a dictionary with all window-local
4216 variables is returned. 4220 variables is returned.
4217 Note that {varname} must be the name without "w:". 4221 Note that {varname} must be the name without "w:".
4218 Tabs are numbered starting with one. For the current tabpage 4222 Tabs are numbered starting with one. For the current tabpage
4219 use |getwinvar()|. 4223 use |getwinvar()|.
4224 {winnr} can be the window number or the window ID.
4220 When {winnr} is zero the current window is used. 4225 When {winnr} is zero the current window is used.
4221 This also works for a global option, buffer-local option and 4226 This also works for a global option, buffer-local option and
4222 window-local option, but it doesn't work for a global variable 4227 window-local option, but it doesn't work for a global variable
4223 or buffer-local variable. 4228 or buffer-local variable.
4224 When the tab, window or variable doesn't exist {def} or an 4229 When the tab, window or variable doesn't exist {def} or an
4339 4344
4340 Without arguments use the current window. 4345 Without arguments use the current window.
4341 With {winnr} use this window in the current tab page. 4346 With {winnr} use this window in the current tab page.
4342 With {winnr} and {tabnr} use the window in the specified tab 4347 With {winnr} and {tabnr} use the window in the specified tab
4343 page. 4348 page.
4349 {winnr} can be the window number or the window ID.
4344 Return 0 if the arguments are invalid. 4350 Return 0 if the arguments are invalid.
4345 4351
4346 hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* 4352 hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()*
4347 The result is a Number, which is 1 if there is a mapping that 4353 The result is a Number, which is 1 if there is a mapping that
4348 contains {what} in somewhere in the rhs (what it is mapped to) 4354 contains {what} in somewhere in the rhs (what it is mapped to)
6285 :endfor 6291 :endfor
6286 < Note: The '[ and '] marks are not set. 6292 < Note: The '[ and '] marks are not set.
6287 6293
6288 setloclist({nr}, {list} [, {action}]) *setloclist()* 6294 setloclist({nr}, {list} [, {action}]) *setloclist()*
6289 Create or replace or add to the location list for window {nr}. 6295 Create or replace or add to the location list for window {nr}.
6290 When {nr} is zero the current window is used. For a location 6296 {nr} can be the window number or the window ID.
6291 list window, the displayed location list is modified. For an 6297 When {nr} is zero the current window is used.
6292 invalid window number {nr}, -1 is returned. 6298
6299 For a location list window, the displayed location list is
6300 modified. For an invalid window number {nr}, -1 is returned.
6293 Otherwise, same as |setqflist()|. 6301 Otherwise, same as |setqflist()|.
6294 Also see |location-list|. 6302 Also see |location-list|.
6295 6303
6296 setmatches({list}) *setmatches()* 6304 setmatches({list}) *setmatches()*
6297 Restores a list of matches saved by |getmatches()|. Returns 0 6305 Restores a list of matches saved by |getmatches()|. Returns 0
6454 settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()* 6462 settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()*
6455 Set option or local variable {varname} in window {winnr} to 6463 Set option or local variable {varname} in window {winnr} to
6456 {val}. 6464 {val}.
6457 Tabs are numbered starting with one. For the current tabpage 6465 Tabs are numbered starting with one. For the current tabpage
6458 use |setwinvar()|. 6466 use |setwinvar()|.
6467 {winnr} can be the window number or the window ID.
6459 When {winnr} is zero the current window is used. 6468 When {winnr} is zero the current window is used.
6460 This also works for a global or local buffer option, but it 6469 This also works for a global or local buffer option, but it
6461 doesn't work for a global or local buffer variable. 6470 doesn't work for a global or local buffer variable.
6462 For a local buffer option the global value is unchanged. 6471 For a local buffer option the global value is unchanged.
6463 Note that the variable name without "w:" must be used. 6472 Note that the variable name without "w:" must be used.
7526 Return the window number of window with ID {expr}. 7535 Return the window number of window with ID {expr}.
7527 Return 0 if the window cannot be found in the current tabpage. 7536 Return 0 if the window cannot be found in the current tabpage.
7528 7537
7529 *winbufnr()* 7538 *winbufnr()*
7530 winbufnr({nr}) The result is a Number, which is the number of the buffer 7539 winbufnr({nr}) The result is a Number, which is the number of the buffer
7531 associated with window {nr}. When {nr} is zero, the number of 7540 associated with window {nr}. {nr} can be the window number or
7532 the buffer in the current window is returned. When window 7541 the window ID.
7533 {nr} doesn't exist, -1 is returned. 7542 When {nr} is zero, the number of the buffer in the current
7543 window is returned.
7544 When window {nr} doesn't exist, -1 is returned.
7534 Example: > 7545 Example: >
7535 :echo "The file in the current window is " . bufname(winbufnr(0)) 7546 :echo "The file in the current window is " . bufname(winbufnr(0))
7536 < 7547 <
7537 *wincol()* 7548 *wincol()*
7538 wincol() The result is a Number, which is the virtual column of the 7549 wincol() The result is a Number, which is the virtual column of the
7539 cursor in the window. This is counting screen cells from the 7550 cursor in the window. This is counting screen cells from the
7540 left side of the window. The leftmost column is one. 7551 left side of the window. The leftmost column is one.
7541 7552
7542 winheight({nr}) *winheight()* 7553 winheight({nr}) *winheight()*
7543 The result is a Number, which is the height of window {nr}. 7554 The result is a Number, which is the height of window {nr}.
7555 {nr} can be the window number or the window ID.
7544 When {nr} is zero, the height of the current window is 7556 When {nr} is zero, the height of the current window is
7545 returned. When window {nr} doesn't exist, -1 is returned. 7557 returned. When window {nr} doesn't exist, -1 is returned.
7546 An existing window always has a height of zero or more. 7558 An existing window always has a height of zero or more.
7547 Examples: > 7559 Examples: >
7548 :echo "The current window has " . winheight(0) . " lines." 7560 :echo "The current window has " . winheight(0) . " lines."
7618 Note that no option values are saved. 7630 Note that no option values are saved.
7619 7631
7620 7632
7621 winwidth({nr}) *winwidth()* 7633 winwidth({nr}) *winwidth()*
7622 The result is a Number, which is the width of window {nr}. 7634 The result is a Number, which is the width of window {nr}.
7635 {nr} can be the window number or the window ID.
7623 When {nr} is zero, the width of the current window is 7636 When {nr} is zero, the width of the current window is
7624 returned. When window {nr} doesn't exist, -1 is returned. 7637 returned. When window {nr} doesn't exist, -1 is returned.
7625 An existing window always has a width of zero or more. 7638 An existing window always has a width of zero or more.
7626 Examples: > 7639 Examples: >
7627 :echo "The current window has " . winwidth(0) . " columns." 7640 :echo "The current window has " . winwidth(0) . " columns."