-added config for showing tabs always

This commit is contained in:
Jelenkee 2024-08-03 12:56:13 +02:00
parent d2ebadb631
commit d385f4b8c5
3 changed files with 16 additions and 8 deletions

View file

@ -31,9 +31,10 @@ marker_marked = { fg = "lightcyan", bg = "lightcyan" }
marker_selected = { fg = "lightyellow", bg = "lightyellow" }
# Tab
tab_active = { reversed = true }
tab_inactive = {}
tab_width = 1
tab_active = { reversed = true }
tab_inactive = {}
tab_width = 1
tab_show_always = false
# Count
count_copied = { fg = "white", bg = "green" }

View file

@ -64,10 +64,11 @@ pub struct Manager {
marker_selected: Style,
// Tab
tab_active: Style,
tab_inactive: Style,
tab_active: Style,
tab_inactive: Style,
#[validate(range(min = 1, message = "Must be greater than 0"))]
tab_width: u8,
tab_width: u8,
tab_show_always: bool,
// Count
count_copied: Style,

View file

@ -71,7 +71,7 @@ end
function Header:tabs()
local tabs = #cx.tabs
if tabs == 1 then
if tabs == 1 and not THEME.manager.tab_show_always then
return ui.Line {}
end
@ -102,7 +102,13 @@ function Header:render()
end
-- Mouse events
function Header:click(event, up) end
function Header:click(event, up)
if up or not event.is_left then
return
end
ya.manager_emit("tab_switch", { 0 })
end
function Header:scroll(event, step) end