Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ddc_vim/deps.ts>fn.matchlist

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

Same as match(), but return a List. The first item in the list is the matched string, same as what matchstr() would return. Following items are submatches, like "\1", "\2", etc. in :substitute. When an optional submatch didn't match an empty string is used. Example:

echo matchlist('acd', '\(a\)\?\(b\)\?\(c\)\?\(.*\)')

Results in: ['acd', 'a', '', 'c', 'd', '', '', '', '', ''] When there is no match an empty list is returned.

You can pass in a List, but that is not very useful.

Can also be used as a method:

GetText()->matchlist('word')

Parameters

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

Returns

Promise<unknown[]>