Skip to main content
Module

x/denops_std/function/vim/mod.ts>exists_compiled

📚 Standard module for denops.vim
Go to Latest
function exists_compiled
import { exists_compiled } from "https://deno.land/x/denops_std@v6.4.0/function/vim/mod.ts";

Like exists() but evaluated at compile time. This is useful to skip a block where a function is used that would otherwise give an error:

if exists_compiled('*ThatFunction')
   ThatFunction('works')
endif

If exists() were used then a compilation error would be given if ThatFunction() is not defined.

{expr} must be a literal string. Can only be used in a :def function. This does not work to check for arguments or local variables.

Parameters

denops: Denops
expr: unknown

Returns

Promise<number>