@@ -42,6 +42,7 @@ class DrawData(NamedTuple):
4242 title_template : str
4343 active_title_template : Optional [str ]
4444 tab_activity_symbol : Optional [str ]
45+ powerline_style : str
4546
4647
4748def as_rgb (x : int ) -> int :
@@ -186,21 +187,30 @@ def draw_tab_with_powerline(draw_data: DrawData, screen: Screen, tab: TabBarData
186187 inactive_bg = as_rgb (color_as_int (draw_data .inactive_bg ))
187188 default_bg = as_rgb (color_as_int (draw_data .default_bg ))
188189
190+ separator_symbol = ''
191+ separator_alt_symbol = ''
192+ if draw_data .powerline_style == 'slanted' :
193+ separator_symbol = ''
194+ separator_alt_symbol = '╱'
195+ elif draw_data .powerline_style == 'round' :
196+ separator_symbol = ''
197+ separator_alt_symbol = ''
198+
189199 min_title_length = 1 + 2
190200
191201 if screen .cursor .x + min_title_length >= screen .columns :
192202 screen .cursor .x -= 2
193203 screen .cursor .bg = default_bg
194204 screen .cursor .fg = inactive_bg
195- screen .draw (' ' )
205+ screen .draw ('{} ' . format ( separator_symbol ) )
196206 return screen .cursor .x
197207
198208 start_draw = 2
199209 if tab .is_active and screen .cursor .x >= 2 :
200210 screen .cursor .x -= 2
201211 screen .cursor .fg = inactive_bg
202212 screen .cursor .bg = tab_bg
203- screen .draw (' ' )
213+ screen .draw ('{} ' . format ( separator_symbol ) )
204214 screen .cursor .fg = tab_fg
205215 elif screen .cursor .x == 0 :
206216 screen .cursor .bg = tab_bg
@@ -224,9 +234,9 @@ def draw_tab_with_powerline(draw_data: DrawData, screen: Screen, tab: TabBarData
224234 screen .cursor .bg = default_bg
225235 else :
226236 screen .cursor .bg = inactive_bg
227- screen .draw ('' )
237+ screen .draw (separator_symbol )
228238 else :
229- screen .draw (' ' )
239+ screen .draw (' {}' . format ( separator_alt_symbol ) )
230240
231241 end = screen .cursor .x
232242 if end < screen .columns :
@@ -273,7 +283,8 @@ def __init__(self, os_window_id: int, opts: Options):
273283 self .opts .inactive_tab_foreground , self .opts .inactive_tab_background ,
274284 self .opts .tab_bar_background or self .opts .background , self .opts .tab_title_template ,
275285 self .opts .active_tab_title_template ,
276- self .opts .tab_activity_symbol
286+ self .opts .tab_activity_symbol ,
287+ self .opts .tab_powerline_style
277288 )
278289 if self .opts .tab_bar_style == 'separator' :
279290 self .draw_func = draw_tab_with_separator
0 commit comments