]>
git.r.bdr.sh - rbdr/dotfiles/blob - config/kitty/tab_bar.py
c88e4836a675ea58cd63cb9bf8597941686a755d
1 from kitty
.fast_data_types
import Screen
2 from kitty
.tab_bar
import DrawData
, ExtraData
, TabBarData
, draw_title
5 draw_data
: DrawData
, screen
: Screen
, tab
: TabBarData
,
6 before
: int, max_tab_length
: int, index
: int, is_last
: bool,
10 orig_bg
= screen
.cursor
.bg
11 orig_fg
= screen
.cursor
.fg
13 screen
.cursor
.fg
= orig_bg
15 screen
.cursor
.bg
= orig_bg
16 screen
.cursor
.fg
= orig_fg
17 draw_title(draw_data
, screen
, tab
, index
, max_tab_length
)
18 trailing_spaces
= min(max_tab_length
- 1, draw_data
.trailing_spaces
)
19 max_tab_length
-= trailing_spaces
20 extra
= screen
.cursor
.x
- before
- max_tab_length
22 screen
.cursor
.x
-= extra
+ 1
25 screen
.cursor
.fg
= orig_bg
28 screen
.cursor
.bold
= screen
.cursor
.italic
= False