Open griimick opened 6 months ago
It works now! Let me know if you think it's a good addition to plugin, I can open PR.
I wanted to have the abiltiy to hide or show inactive tabs and I found your proposal, so I decided to combine them :smile:
You can include it in your PR if the author thinks it's a good idea.
local function hide_or_display_inactive(tabtitle)
if not tab.is_active and C.tabs.hide_inactive.enabled then
return ""
end
return tabtitle
end
local tabtitle = tab.tab_title
if #tabtitle > 0 then
if not C.tabs.hide_inactive.ignore_renamed then
tabtitle = hide_or_display_inactive(tabtitle)
end
else
tabtitle = hide_or_display_inactive(tab.active_pane.title)
end
I have the following config structure in mind, but we can change it to something else if it makes more sense:
tabs = {
hide_inactive = {
enabled = false,
ignore_renamed = false,
},
},
I added a keybind to rename active tab title as described in here and am trying to make the plugin pick the custom renamed title.
Then, made a change in the
format-tab-title
event handler to get the custom title usingtab:get_title()
instead oftab.active_pane.title
. I am getting this unexpected output.lmk if you have inputs on what I might be doing wrong. Thanks!
After change: ("nani" was set using the keybind that uses
tab:set_title(line)
)Original: