MingaEditor.Shell.Traditional.TabBarRenderer (Minga v0.1.0)

Copy Markdown View Source

Renders the tab bar at the top of the screen.

Produces a list of draw commands for row 0 and a list of click regions for mouse hit-testing, following the same segment pattern as the modeline renderer.

Uses Powerline slant separators between tabs and handles overflow when tabs exceed the terminal width by scrolling to keep the active tab visible.

Close button behavior

Each tab reserves space for a close icon ("✕"). The icon is visible on the active tab always, and on inactive tabs only when the mouse hovers over that tab's region. When hidden, the reserved space renders as blank (fg matches bg). Tab widths are stable regardless of hover state.

Summary

Types

A clickable region: column range mapping to a command.

Functions

Renders the tab bar at the given row.

Types

click_region()

@type click_region() ::
  {col_start :: non_neg_integer(), col_end :: non_neg_integer(),
   command :: atom()}

A clickable region: column range mapping to a command.

Functions

render(row, cols, tb, theme, hover_col \\ nil)

Renders the tab bar at the given row.

hover_col is the mouse column if the mouse is hovering on the tab bar row, or nil if not hovering. Used to determine which inactive tab (if any) should reveal its close button.

Returns {draw_commands, click_regions}.