@@ -2485,14 +2485,14 @@ browse({save}, {title}, {initdir}, {default})
24852485 String put up a file requester
24862486browsedir({title}, {initdir}) String put up a directory requester
24872487bufadd({name}) Number add a buffer to the buffer list
2488- bufexists({expr }) Number |TRUE| if buffer {expr } exists
2489- buflisted({expr }) Number |TRUE| if buffer {expr } is listed
2490- bufload({expr }) Number load buffer {expr } if not loaded yet
2491- bufloaded({expr }) Number |TRUE| if buffer {expr } is loaded
2492- bufname([{expr }]) String Name of the buffer {expr }
2493- bufnr([{expr } [, {create}]]) Number Number of the buffer {expr }
2494- bufwinid({expr }) Number window ID of buffer {expr }
2495- bufwinnr({expr }) Number window number of buffer {expr }
2488+ bufexists({buf }) Number |TRUE| if buffer {buf } exists
2489+ buflisted({buf }) Number |TRUE| if buffer {buf } is listed
2490+ bufload({buf }) Number load buffer {buf } if not loaded yet
2491+ bufloaded({buf }) Number |TRUE| if buffer {buf } is loaded
2492+ bufname([{buf }]) String Name of the buffer {buf }
2493+ bufnr([{buf } [, {create}]]) Number Number of the buffer {buf }
2494+ bufwinid({buf }) Number window ID of buffer {buf }
2495+ bufwinnr({buf }) Number window number of buffer {buf }
24962496byte2line({byte}) Number line number at byte count {byte}
24972497byteidx({expr}, {nr}) Number byte index of {nr}'th char in {expr}
24982498byteidxcomp({expr}, {nr}) Number byte index of {nr}'th char in {expr}
@@ -2574,6 +2574,7 @@ executable({expr}) Number 1 if executable {expr} exists
25742574execute({command}) String execute {command} and get the output
25752575exepath({expr}) String full path of the command {expr}
25762576exists({expr}) Number |TRUE| if {expr} exists
2577+ exists_compiled({expr}) Number |TRUE| if {expr} exists at compile time
25772578exp({expr}) Float exponential of {expr}
25782579expand({expr} [, {nosuf} [, {list}]])
25792580 any expand special keywords in {expr}
@@ -4454,8 +4455,10 @@ exepath({expr}) *exepath()*
44544455 *exists()*
44554456exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
44564457 zero otherwise.
4457- Note: In a compiled |:def| function local variables and
4458- arguments are not visible to `exists()`.
4458+
4459+ Note: In a compiled |:def| function the evaluation is done at
4460+ runtime. Use `exists_compiled()` to evaluate the expression
4461+ at compile time.
44594462
44604463 For checking for a supported feature use |has()|.
44614464 For checking if a file exists use |filereadable()|.
@@ -4546,8 +4549,23 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
45464549
45474550 Can also be used as a |method|: >
45484551 Varname()->exists()
4552+ <
4553+
4554+ exists_compiled({expr}) *exists_compiled()*
4555+ Like `exists()` but evaluated at compile time. This is useful
4556+ to skip a block where a function is used that would otherwise
4557+ give an error: >
4558+ if exists_compiled('*ThatFunction')
4559+ ThatFunction('works')
4560+ endif
4561+ < If `exists()` were used then a compilation error would be
4562+ given if ThatFunction() is not defined.
4563+
4564+ {expr} must be a literal string. *E1232*
4565+ Can only be used in a |:def| function. *E1233*
4566+
45494567
4550- exp({expr}) *exp()*
4568+ exp({expr}) *exp()*
45514569 Return the exponential of {expr} as a |Float| in the range
45524570 [0, inf].
45534571 {expr} must evaluate to a |Float| or a |Number|.
@@ -6446,7 +6464,7 @@ has({feature} [, {check}])
64466464 features that have been abandoned will not be known by the
64476465 current Vim version.
64486466
6449- Also see |exists()|.
6467+ Also see |exists()| and |exists_compiled()| .
64506468
64516469 Note that to skip code that has a syntax error when the
64526470 feature is not available, Vim may skip the rest of the line
0 commit comments