Skip to main content
Module

x/dpp_vim/deps.ts>fn.winlayout

Dark powered plugin manager for Vim/neovim
Latest
function fn.winlayout
import { fn } from "https://deno.land/x/dpp_vim@v0.2.0/deps.ts";
const { winlayout } = fn;

The result is a nested List containing the layout of windows in a tabpage.

Without {tabnr} use the current tabpage, otherwise the tabpage with number {tabnr}. If the tabpage {tabnr} is not found, returns an empty list.

For a leaf window, it returns: ['leaf', {winid}] For horizontally split windows, which form a column, it returns: ['col', [{nested list of windows}]] For vertically split windows, which form a row, it returns: ['row', [{nested list of windows}]]

Example:

" Only one window in the tab page
:echo winlayout()
['leaf', 1000]
" Two horizontally split windows
:echo winlayout()
['col', [['leaf', 1000], ['leaf', 1001]]]
" The second tab page, with three horizontally split
" windows, with two vertically split windows in the
" middle window
:echo winlayout(2)
['col', [['leaf', 1002], ['row', [['leaf', 1003],
                    ['leaf', 1001]]], ['leaf', 1000]]]

Can also be used as a method:

GetTabnr()->winlayout()

Parameters

denops: Denops
optional
tabnr: unknown

Returns

Promise<unknown[]>