Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.getmatches

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

Returns a List with all matches previously defined for the current window by matchadd() and the :match commands. getmatches() is useful in combination with setmatches(), as setmatches() can restore a list of matches saved by getmatches(). If {win} is specified, use the window with this number or window ID instead of the current window. If {win} is invalid, an empty list is returned. Example:

:echo getmatches()

    [{'group': 'MyGroup1', 'pattern': 'TODO',
    'priority': 10, 'id': 1}, {'group': 'MyGroup2',
    'pattern': 'FIXME', 'priority': 10, 'id': 2}]

        :let m = getmatches()
        :call clearmatches()
        :echo getmatches()

    []

        :call setmatches(m)
        :echo getmatches()

    [{'group': 'MyGroup1', 'pattern': 'TODO',
    'priority': 10, 'id': 1}, {'group': 'MyGroup2',
    'pattern': 'FIXME', 'priority': 10, 'id': 2}]

        :unlet m

Parameters

denops: Denops
optional
win: unknown

Returns

Promise<unknown[]>