Open rkulla opened 1 year ago
It also happens with or without adding extensions = {'fugitive'}
I can't reproduce it. The completion cycling is working correctly for me with FugitiveHead
. To be honest, here we are doing nothing but calling the FugitiveHead()
viml function that vim-fugitive provides. It seems unlikely that this is a lualine bug.
Interesting. It was the only way I could reproduce it but it must be something else conflicting with it then. Thanks.
I did some debugging and was able to narrow this down to a combination of using FugitiveHead
along with the change introduced in this commit for vim-fugitive
: https://github.com/tpope/vim-fugitive/commit/4b0f2b604
I found that commit by running git bisect on the Fugitive tree between known working good and bad versions.
I walked through changes within that diff and it turns out when expand()
is called on line 401, it produces the bug. The expand call itself works and doesn't appear to error, however if I replace expand('~')
with /home/vividboarder
, the bug goes away. If I wrap the known directory with expand
again (expand('/home/vividboarder')
) it returns. So I'm fairly confident it's to do with the expand(...)
function being called in this context.
To avoid the issue for now, you can pin vim-fugitive just before this commit or at the previous tag, v3.6.
I reproduced the issue without vim-fugitive by simply adding local _ = vim.fn.expand('~')
to one of my existing lualine section functions. Interestingly, local _ = vim.fn.expand('%')
does not produce this issue. So there is something likely going on within expand(...)
.
expand | result |
---|---|
expand('~') |
bad |
expand('/') |
bad |
expand('') |
bad |
expand('%') |
ok |
Found a related neovim issue: https://github.com/neovim/neovim/issues/10121.
This is definitely due to a Neovim bug, but there's probably not much value in refreshing the status line when the cursor moves through items in the wildmenu
. If this can be determined and short-circuiting from the refresh
function, then the bug would be mitigated and result in a minor improvement to runtime experience.
For me, it is different a little bit. After closing fugitive.nvim
window, the branch
component in the lualine
goes away and then I will have to take action to update the lualine.nvim
.
Does seem to work in newer neovim's that fixed the expand bug. Thanks.
Self Checks
How to reproduce the problem
Expected behaviour
:Packer[tab] cycles through whole menu
Actual behaviour
:Packer[tab] doesn't cycle through whole menu. (:Packer is just an example but really any :Command[tab] has same issue)
Minimal config to reproduce the issue
lualine_a = {'FugitiveHead'},
Aditional information
This works fine: lualine_a = {'branch'},
It's only when I use FugitiveHead that this happens. I tried most combinations of vim-fugitive being in start/ or opt/ and/or lualine being in start/ or /opt.