import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { getmousepos } = fn;
Returns a Dictionary
with the last known position of the
mouse. This can be used in a mapping for a mouse click or in
a filter of a popup window. The items are:
screenrow screen row
screencol screen column
winid Window ID of the click
winrow row inside "winid"
wincol column inside "winid"
line text line inside "winid"
column text column inside "winid"
All numbers are 1-based.
If not over a window, e.g. when in the command line, then only "screenrow" and "screencol" are valid, the others are zero.
When on the status line below a window or the vertical separator right of a window, the "line" and "column" values are zero.
When the position is after the text then "column" is the length of the text in bytes plus one.
If the mouse is over a popup window then that window is used.
When using getchar()
the Vim variables v:mouse_lnum
,
v:mouse_col
and v:mouse_winid
also provide these values.