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.