Closed ehaynes99 closed 1 year ago
I think it's fine. This way it's easier for users to modify the tab name. If you don't want the numbers use mode = 1
.
lualine_a = {
{
'tabs',
mode = 1,
fmt = function(name, context)
return 'hello!'
end,
},
I see what you mean. It's a bit surprising. I would think if fmt
is specified, it would apply without having to explicitly set mode
. Since the default settings set mode = 0
, it's just discarded.
Self Checks
How to reproduce the problem
Load with config as below
Expected behaviour
The tabs would be displayed with
hello!
Actual behaviour
The tabs are displayed as their number
Minimal config to reproduce the issue
Additional information
In
lua/lualine/components/tabs/tab.lua
, the render function looks like:The name is set to the result of the
fmt
function. However, the following conditional overwrites it in all cases, either with the ellipsis or the mode value. I started to make a PR, but I'm not entirely clear on howellipse
is supposed to behave. If it should take precedence over thefmt
function's result, it could be changed to:If
fmt
should take precedence overellipse
, it would be: