import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { screenpos } = fn;
The result is a Dict with the screen position of the text
character in window {winid} at buffer line {lnum} and column
{col}. {col} is a one-based byte index.
The Dict has these members:
row screen row
col first screen column
endcol last screen column
curscol cursor screen column
If the specified position is not visible, all values are zero.
The "endcol" value differs from "col" when the character
occupies more than one screen cell. E.g. for a Tab "col" can
be 1 and "endcol" can be 8.
The "curscol" value is where the cursor would be placed. For
a Tab it would be the same as "endcol", while for a double
width character it would be the same as "col".
The conceal
feature is ignored here, the column numbers are
as if 'conceallevel' is zero. You can set the cursor to the
right position and use screencol()
to get the value with
conceal
taken into account.
If the position is in a closed fold the screen position of the
first character is returned, {col} is not used.
Returns an empty Dict if {winid} is invalid.
Can also be used as a method
:
GetWinid()->screenpos(lnum, col)