Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.winnr

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.winnr
import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { winnr } = fn;

The result is a Number, which is the number of the current window. The top window has number 1. Returns zero for a popup window.

The optional argument {arg} supports the following values: $ the number of the last window (the window count). # the number of the last accessed window (where CTRL-W_p goes to). If there is no previous window or it is in another tab page 0 is returned. **{N}**j the number of the Nth window below the current window (where CTRL-W_j goes to). **{N}**k the number of the Nth window above the current window (where CTRL-W_k goes to). **{N}**h the number of the Nth window left of the current window (where CTRL-W_h goes to). **{N}**l the number of the Nth window right of the current window (where CTRL-W_l goes to). The number can be used with CTRL-W_w and ":wincmd w" :wincmd. When {arg} is invalid an error is given and zero is returned. Also see tabpagewinnr() and win_getid(). Examples:

let window_count = winnr('$')
let prev_window = winnr('#')
let wnum = winnr('3k')

Can also be used as a method:

GetWinval()->winnr()

Parameters

denops: Denops
optional
arg: unknown

Returns

Promise<number>