Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/mod.ts>winwidth

๐Ÿ“š Standard module for denops.vim
Go to Latest
function winwidth
import { winwidth } from "https://deno.land/x/denops_std@v5.0.2/function/mod.ts";

The result is a Number, which is the width of window {nr}. {nr} can be the window number or the window-ID. When {nr} is zero, the width of the current window is returned. When window {nr} doesn't exist, -1 is returned. An existing window always has a width of zero or more. Examples:

:echo "The current window has " .. winwidth(0) .. " columns."
:if winwidth(0) <= 50
:  50 wincmd |
:endif

For getting the terminal or screen size, see the 'columns' option.

Can also be used as a method:

GetWinid()->winwidth()

Parameters

denops: Denops
nr: unknown

Returns

Promise<number>