-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
}
The tabpage number
The Window objects representing the tabpage's windows.
The currently focused window in the tabpage
Whether the tabpage is the current tabpage
Whether the tabpage is first in the list of tabpages (the smallest tabnr returned from vim.api.nvim_list_tabpages()
).
Whether the tabpage is last in the list of tabpages (the largest tabnr returned from vim.api.nvim_list_tabpages()
).
Focuses the tabpage. Equivalent to vim.api.nvim_set_current_tabpage(TabPage.number)
.
Closes the tabpage, as long as it is not the last one open.
- pick(goal) Focus or close a buffer using pick letters.
- by_step(goal, step) Focus or close a buffer using a relative offset (-1, 1, etc.)
- by_index(goal, idx) Focus or close a buffer by its index.
- buf_delete(bufnr, wipe) Delete the given buffer while maintaining window layout.
-
get_hl(group_name)
Memoized wrapper around
nvim_get_hl
-
get_hl_attr(group_name, attr)
Get a single attribute from a hlgroup. Memoized with same cache as
get_hl
.
- is_visible(bufnr) Returns true if the buffer is visible.
- get_current() Returns the Buffer object for the current buffer.
- get_buffer(bufnr) Returns the Buffer object for the given bufnr, if valid.
- get_visible() Returns a list of visible Buffer objects.
- get_valid_buffers() Returns a list of valid buffers.
- move_buffer(buffer, target) Move a buffer to a different position.
- release_taken_letter(bufnr) Release the pick letter for a Buffer object.
- update_current(tabnr)
- fetch_tabs() Update the list of tabpges.
- get_tabs() Returns a list of Tabpage objects.
- get_tabpage(tabnr) Returns the Tabpage object for tabnr, if valid.
- 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.