mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
-added config for showing tabs always
This commit is contained in:
parent
d2ebadb631
commit
d385f4b8c5
3 changed files with 16 additions and 8 deletions
|
|
@ -34,6 +34,7 @@ marker_selected = { fg = "lightyellow", bg = "lightyellow" }
|
||||||
tab_active = { reversed = true }
|
tab_active = { reversed = true }
|
||||||
tab_inactive = {}
|
tab_inactive = {}
|
||||||
tab_width = 1
|
tab_width = 1
|
||||||
|
tab_show_always = false
|
||||||
|
|
||||||
# Count
|
# Count
|
||||||
count_copied = { fg = "white", bg = "green" }
|
count_copied = { fg = "white", bg = "green" }
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ pub struct Manager {
|
||||||
tab_inactive: Style,
|
tab_inactive: Style,
|
||||||
#[validate(range(min = 1, message = "Must be greater than 0"))]
|
#[validate(range(min = 1, message = "Must be greater than 0"))]
|
||||||
tab_width: u8,
|
tab_width: u8,
|
||||||
|
tab_show_always: bool,
|
||||||
|
|
||||||
// Count
|
// Count
|
||||||
count_copied: Style,
|
count_copied: Style,
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ end
|
||||||
|
|
||||||
function Header:tabs()
|
function Header:tabs()
|
||||||
local tabs = #cx.tabs
|
local tabs = #cx.tabs
|
||||||
if tabs == 1 then
|
if tabs == 1 and not THEME.manager.tab_show_always then
|
||||||
return ui.Line {}
|
return ui.Line {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -102,7 +102,13 @@ function Header:render()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Mouse events
|
-- 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
|
function Header:scroll(event, step) end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue