nvim-lualine / lualine.nvim

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

fzf-lua extension: filetype not recognised #860

Closed gennaro-tedesco closed 1 year ago

gennaro-tedesco commented 1 year ago

Motivation

More than a feature a request for advice: I would like to write an extension for fzf-lua and I have seen that a current fzf extension already exists: as far as I understand such extension solely checks the filetype of the current window and returns a string component in one of the lualine sections. Whilst this works with fzf.vim, it fails with fzf-lua although the filetype is the same (see cross post discussion). By failing I mean that nothing is being shown although explicitly invoked.

Perhaps my understanding of the extension mechanics is incorrect, and besides the filetype other checks are performed? Could you provide more explanation on the topic? :)

shadmansaleh commented 1 year ago

Your assumption is right it's just filetype check.

It's not working for fzf-lua because fzf-lua gets rendered on a floating windows and floating windows don't have a statusline. If set inactive_statusline in extension it'll appear all the other windows apart from the fzf one. If you use globalstatus it'll be rendered properly as with gloalstatusline we can render statusline for floating windows too in the same statusline spot. I think you can try setting the winbar in the extension and see if you like it. floating windows can have winbars but not statusline it's a limitation in neovim currently.

gennaro-tedesco commented 1 year ago

Thank you for your thorough explanation: I will experiment with inactive sections and winbar and see what comes comes out of it! :)

Edit: I have tried invoking the components as winbar sections (and inactive statusline sections) but they still disappear once the floating window pops-up: are we sure that

floating windows can have winbars

?