Skip to main content
Module

x/denops_std/function/mod.ts>getmousepos

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

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" coladd offset (in screen columns) from the start of the clicked char 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.

Returns

Promise<Record<string, unknown>>