@@ -2473,14 +2473,14 @@ browse({save}, {title}, {initdir}, {default})
24732473 String put up a file requester
24742474browsedir({title}, {initdir}) String put up a directory requester
24752475bufadd({name}) Number add a buffer to the buffer list
2476- bufexists({expr }) Number |TRUE| if buffer {expr } exists
2477- buflisted({expr }) Number |TRUE| if buffer {expr } is listed
2478- bufload({expr }) Number load buffer {expr } if not loaded yet
2479- bufloaded({expr }) Number |TRUE| if buffer {expr } is loaded
2480- bufname([{expr }]) String Name of the buffer {expr }
2481- bufnr([{expr } [, {create}]]) Number Number of the buffer {expr }
2482- bufwinid({expr }) Number window ID of buffer {expr }
2483- bufwinnr({expr }) Number window number of buffer {expr }
2476+ bufexists({buf }) Number |TRUE| if buffer {buf } exists
2477+ buflisted({buf }) Number |TRUE| if buffer {buf } is listed
2478+ bufload({buf }) Number load buffer {buf } if not loaded yet
2479+ bufloaded({buf }) Number |TRUE| if buffer {buf } is loaded
2480+ bufname([{buf }]) String Name of the buffer {buf }
2481+ bufnr([{buf } [, {create}]]) Number Number of the buffer {buf }
2482+ bufwinid({buf }) Number window ID of buffer {buf }
2483+ bufwinnr({buf }) Number window number of buffer {buf }
24842484byte2line({byte}) Number line number at byte count {byte}
24852485byteidx({expr}, {nr}) Number byte index of {nr}'th char in {expr}
24862486byteidxcomp({expr}, {nr}) Number byte index of {nr}'th char in {expr}
@@ -2562,6 +2562,7 @@ executable({expr}) Number 1 if executable {expr} exists
25622562execute({command}) String execute {command} and get the output
25632563exepath({expr}) String full path of the command {expr}
25642564exists({expr}) Number |TRUE| if {expr} exists
2565+ exists_compiled({expr}) Number |TRUE| if {expr} exists at compile time
25652566exp({expr}) Float exponential of {expr}
25662567expand({expr} [, {nosuf} [, {list}]])
25672568 any expand special keywords in {expr}
@@ -4442,8 +4443,10 @@ exepath({expr}) *exepath()*
44424443 *exists()*
44434444exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
44444445 zero otherwise.
4445- Note: In a compiled |:def| function local variables and
4446- arguments are not visible to `exists()`.
4446+
4447+ Note: In a compiled |:def| function the evaluation is done at
4448+ runtime. Use `exists_compiled()` to evaluate the expression
4449+ at compile time.
44474450
44484451 For checking for a supported feature use |has()|.
44494452 For checking if a file exists use |filereadable()|.
@@ -4534,8 +4537,23 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
45344537
45354538 Can also be used as a |method|: >
45364539 Varname()->exists()
4540+ <
4541+
4542+ exists_compiled({expr}) *exists()*
4543+ Like `exists()` but evaluated at compile time. This is useful
4544+ to skip a block where a function is used that would otherwise
4545+ give an error: >
4546+ if exists_compiled('*ThatFunction')
4547+ ThatFunction('works')
4548+ endif
4549+ < If `exists()` were used then a compilation error would be
4550+ given if ThatFunction() is not defined.
4551+
4552+ {expr} must be a literal string. *E1232*
4553+ Can only be used in a |:def| function. *E1233*
4554+
45374555
4538- exp({expr}) *exp()*
4556+ exp({expr}) *exp()*
45394557 Return the exponential of {expr} as a |Float| in the range
45404558 [0, inf].
45414559 {expr} must evaluate to a |Float| or a |Number|.
@@ -6434,7 +6452,7 @@ has({feature} [, {check}])
64346452 features that have been abandoned will not be known by the
64356453 current Vim version.
64366454
6437- Also see |exists()|.
6455+ Also see |exists()| and |exists_compiled()| .
64386456
64396457 Note that to skip code that has a syntax error when the
64406458 feature is not available, Vim may skip the rest of the line
0 commit comments