Skip to main content
Module

x/denops_std/function/mod.ts>synstack

📚 Standard module for denops.vim
Go to Latest
function synstack
import { synstack } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

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[]>