Skip to main content
Module

x/ddc_vim/deps.ts>fn.searchdecl

Dark deno-powered completion framework for neovim/Vim8
Go to Latest
function fn.searchdecl
import { fn } from "https://deno.land/x/ddc_vim@v2.3.0/deps.ts";
const { searchdecl } = fn;

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()

Parameters

denops: Denops
name: unknown
optional
global: unknown
optional
thisblock: unknown

Returns

Promise<unknown>