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

x/ddc_vim/deps.ts>fn.synstack

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

Return a List, which is the stack of syntax items at the position {lnum} and {col} in the current window. {lnum} is used like with getline(). Each item in the List is an ID like what synID() returns. The first item in the List is the outer region, following are items contained in that one. The last one is what synID() returns, unless not the whole item is highlighted or it is a transparent item. This function is useful for debugging a syntax file. Example that shows the syntax stack under the cursor:

for id in synstack(line("."), col("."))
   echo synIDattr(id, "name")
endfor

When the position specified with {lnum} and {col} is invalid an empty List is returned. The position just after the last character in a line and the first column in an empty line are valid positions.

Parameters

denops: Denops
lnum: unknown
col: unknown

Returns

Promise<unknown[]>