Commit graph

11 commits

Author SHA1 Message Date
Kovid Goyal
dd2c59d255
autoformat 2026-08-05 07:16:05 +05:30
Kovid Goyal
7f0b072f0d
autoformat 2026-08-05 05:32:56 +05:30
copilot-swe-agent[bot]
a31f9e52f2
Refactor kitty_tests: move __init__.py code to base.py, update all imports 2026-08-05 05:32:54 +05:30
Kovid Goyal
75bd9d7979
Improve fade style for vertical tab bar 2026-08-02 21:54:56 +05:30
Kovid Goyal
70bdd4e96e
Fix quadratic algorithms in previous PR 2026-08-02 21:14:03 +05:30
Chance Zibolski
e7d8d17755 Vertical tabs: test wrapping combined with the line limit
Wrapping and tab_title_max_lines already compose, since wrapping runs before the
line limit is applied. Cover the combinations that were only checked by hand:
explicit newlines wrapped independently of each other, a wrap width wider than
the tab bar being clamped to it, and wrapped tabs packing by the lines they use
until the overflow ellipsis takes over.
2026-08-01 09:18:15 -07:00
Chance Zibolski
51ebfe4912 Vertical tabs: add tab_title_wrap to wrap long titles
A tab title too wide for the sidebar could only be truncated, which is wasteful
now that a title may use several lines. Add tab_title_wrap, accepting no (the
default, truncate as before), yes to wrap at the width of the tab bar, or a
number to wrap at that many cells.

Wrapping happens on grapheme boundaries so a line break can never land inside a
multi-codepoint grapheme, and SGR escapes are treated as zero width so colors
from tab_title_template neither consume cells nor get split in half. Wrapping is
bounded by tab_title_max_lines, and when a title needs more lines than it is
allowed the last line it gets is truncated with an ellipsis, which also makes
dropped lines visible for titles containing explicit newlines.

Only vertical tab bars are affected, since wrapping requires more than one row.
2026-08-01 09:18:15 -07:00
Chance Zibolski
4ccb98058b Vertical tabs: fill the tab background for the full width of the tab bar
Each line of a vertical tab was only painted as far as its text reached, so the
tab background ended mid row and the sidebar showed a ragged right edge. This
was already the case for single line titles, but multi-line titles make it
obvious, since the lines of one title rarely have the same length.

Paint the tab's full width before drawing the title over it, so every line a tab
occupies is filled in that tab's colors.
2026-08-01 09:18:15 -07:00
Chance Zibolski
26032a4802 Vertical tabs: support multi-line tab titles
Newlines in tab_title_template were drawn as a linefeed without a carriage
return, so each line started where the previous one ended, staircasing to the
right. Titles also collided with the tab below them after two lines, because
update_vertical assumed a fixed two line stride per tab.

Set LNM on the tab bar screen so a newline returns to the start of the next
line, measure how many lines each title actually occupies, and pack tabs at
cumulative offsets.

The blank line between tabs is preserved: one is inserted between tabs while
there is room, and dropped automatically once the tabs need the space, as
before. Previously this fell out of every tab reserving two lines, which is no
longer true now that a tab occupies only as many lines as its title needs.

The number of lines a title may use is limited by the new tab_title_max_lines
option, defaulting to 1 so existing configurations render as before. Lines
beyond the limit are dropped rather than bleeding into the next tab, and a title
is never allowed to use more lines than remain below it, since drawing past the
last line would scroll the tab bar and lose the tabs already drawn.

Only vertical tab bars are affected; horizontal tab bars share a single row.
2026-08-01 09:17:55 -07:00
Bruno Volpato
8d935486ef tabbar: address vertical alignment feedback 2026-04-25 15:21:50 -04:00
bvolpato
19ea73f047 Add vertical tab bars on the left and right
Teach tab_bar_edge about left and right sidebars and route tab layout,
hit-testing, and drag/drop through the vertical axis when needed.
2026-04-25 15:08:15 -04:00