Skip to main content
Module

x/ddc_vim/deps.ts>fn.matchstr

Dark deno-powered completion framework for neovim/Vim
Latest
function fn.matchstr
import { fn } from "https://deno.land/x/ddc_vim@v4.3.1/deps.ts";
const { matchstr } = fn;

Same as match(), but return the matched string. Example:

:echo matchstr("testing", "ing")

results in "ing". When there is no match "" is returned. The {start}, if given, has the same meaning as for match().

:echo matchstr("testing", "ing", 2)

results in "ing".

:echo matchstr("testing", "ing", 5)

result is "". When {expr} is a List then the matching item is returned. The type isn't changed, it's not necessarily a String.

Can also be used as a method:

GetText()->matchstr('word')

Parameters

denops: Denops
expr: unknown
pat: unknown
optional
start: unknown
optional
count: unknown

Returns

Promise<string>