Feat: More flexible way to disable lualine or enable extensions
9ary opened this issue · 0 comments
Requested feature
Currently lualine can only disable itself (or enable an extension) based on filetype. I'd like to be able to check for other things like variables, or even better, provide a custom filter function.
Motivation
Plugins don't always use their own filetypes for their buffers. For example, undotree uses diff
for its diff panel, but it also sets b:isUndotreeBuffer
, so those buffers can still be identified easily, but lualine is currently incapable of recognizing this.
https://github.com/mbbill/undotree/blob/aa93a7e5890dbbebbc064cd22260721a6db1a196/autoload/undotree.vim#L559-L561
See also airline's extension for this plugin: https://github.com/vim-airline/vim-airline/blob/master/autoload/airline/extensions/undotree.vim
It looks for t:undotree
instead, but the idea is the same.