import { searchdecl } from "https://deno.land/x/denops_std@v5.0.2/function/mod.ts";
Search for the declaration of {name}.
With a non-zero {global} argument it works like gD
, find
first match in the file. Otherwise it works like gd
, find
first match in the function.
With a non-zero {thisblock} argument matches in a {} block that ends before the cursor position are ignored. Avoids finding variable declarations only valid in another scope.
Moves the cursor to the found match. Returns zero for success, non-zero for failure. Example:
if searchdecl('myvar') == 0
echo getline('.')
endif
Can also be used as a method
:
GetName()->searchdecl()