Skip to main content

Module tab

Module tab 

Source
Expand description

Tabs (issue #29, 2026-05-22).

In vim a “tab page” is a container of windows — each tab owns its own pane tree. Buffers stay globally shared so the same buffer can appear in multiple tabs.

Lattice mirrors that model:

  • TabSlot is a stash of one tab’s pane tree + optional label.
  • Editor.pane_tree remains the live PaneTree for the active tab (zero-churn for the hundreds of editor.pane_tree call sites).
  • Editor.tabs: Vec<TabSlot> holds one entry per tab, including the active one. The active tab’s panes field in that vec is a default placeholder while it’s “live”; on tab switch we mem::swap between editor.pane_tree and editor.tabs[target].panes.

§Tab IDs

Tabs carry a process-monotonic TabId (parallels PaneId / BufferId). Useful for stable references in render state and events — index-based addressing changes when tabs are reordered or closed.

Structs§

TabId
Process-monotonic tab id. Stable across reorder / close.
TabSlot
One tab’s stashed state. The active tab’s panes is a default-empty placeholder while that tab is live (its real panes live on editor.pane_tree). Inactive tabs hold the full pane tree here.

Enums§

TablineShow
:set tabline.show=... (issue #29, 2026-05-22). Controls when the tabline row is visible at the top of the screen.