Skip to content

TabPage

Will Hopkins edited this page Jul 2, 2023 · 2 revisions

TabPage

Some of the configuration options can be functions that take a TabPage as a single parameter. This is useful as it allows users to set the values of components dynamically based on the buffer that component is being rendered for.

TabPage = {
  number = integer,
  windows = Window[],
  focused = Window,
  is_active = boolean,
  is_first = boolean,
  is_last = boolean
}

Properties

number: integer

The tabpage number

windows: Window[]

The Window objects representing the tabpage's windows.

focused: Window

The currently focused window in the tabpage

is_active: boolean

Whether the tabpage is the current tabpage

is_first: boolean

Whether the tabpage is first in the list of tabpages (the smallest tabnr returned from vim.api.nvim_list_tabpages()).

is_last: boolean

Whether the tabpage is last in the list of tabpages (the largest tabnr returned from vim.api.nvim_list_tabpages()).

Methods

TabPage:focus()

Focuses the tabpage. Equivalent to vim.api.nvim_set_current_tabpage(TabPage.number).

TabPage:close()

Closes the tabpage, as long as it is not the last one open.

API Reference

Objects

Functions

cokeline.mappings

cokeline.utils

cokeline.hlgroups

cokeline.buffers

cokeline.tabs

cokeline.history

  • push(bufnr) Push an item into the history.
  • pop() Pop the last item off of the history.
  • list() Returns the history items as a (copied) list.
  • iter() Returns an iterator over the history items.
  • get(idx) Get the item at history index idx, if any.
  • last() Peek the last item in the history, without removing it.
  • contains(bufnr) Check if the history contains the given bufnr.
  • capacity() Returns the configured capacity.
  • len() Returns the number of items in the history.
Clone this wiki locally