Skip to main content
Module

x/ddc_vim/deps.ts>fn.synID

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

The result is a Number, which is the syntax ID at the position {lnum} and {col} in the current window. The syntax ID can be used with |synIDattr()| and |synIDtrans()| to obtain syntax information about text. {col} is 1 for the leftmost column, {lnum} is 1 for the first line. 'synmaxcol' applies, in a longer line zero is returned. Note that when the position is after the last character, that's where the cursor can be in Insert mode, synID() returns zero. When {trans} is |TRUE|, transparent items are reduced to the item that they reveal. This is useful when wanting to know the effective color. When {trans} is |FALSE|, the transparent item is returned. This is useful when wanting to know which syntax item is effective (e.g. inside parens). Warning: This function can be very slow. Best speed is obtained by going through the file in forward direction. Example (echoes the name of the syntax item under the cursor): :echo synIDattr(synID(line("."), col("."), 1), "name")

Parameters

denops: Denops
lnum: unknown
col: unknown
trans: unknown

Returns

Promise<unknown>