nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
6.28k stars 469 forks source link

suggestion add components hide priority #599

Open askfiy opened 2 years ago

askfiy commented 2 years ago

Thank you so much for developing such a great plugin.

Is it possible to add different components show/hide priority? Similar to:

lualine_x = {
        {"encoding", cond = disable_built_component, priority = 1},
        {"fileformat", cond = disable_built_component, priority = 2},
        {"filetype", cond = disable_built_component, priority = 3}
}

When two components collide, automatically close the component with lower priority.

Like feline does:

Peek 2022-03-06 23-49

It's a cool feature, users can choose which components they want to keep based on the size of the form, it looks pretty good, what do you think?

shadmansaleh commented 2 years ago

I'm aware of this feature. It's something I was planning on implementing as solution to #225 . The issue is the way feline does it is quite inefficient . As it keeps reevaluating statusline expression until it fits . The other solution is to pre evaluate statusline expression in component level and store the length for component removal . Either way it'll probably require a good refactor as currently we mostly just treat component result as strings that will be concated . I currently just don't have time to do a big refactor like that . Once some one sends a pr or I can get the time this can be added.

Alex23rodriguez commented 5 months ago

any updates on this?

cohml commented 1 week ago

+1. This one seems like a no-brainer. Would love to have it implemented.