Closed gh-liu closed 2 weeks ago
Thanks for the issue!
'mini.diff' was indeed a source of the issue, but it surfaced mostly due to (what seems to me like) an unreasonable behavior from some other plugin. However, this particular case should be fixed on latest main
.
The culprit was that 'mini.diff' tried to auto enable buffer from step 5 during step 6. This happened because that target buffer was not completely removed but hidden and unloaded (which made it perfectly valid for auto enabling). During enable()
, there is a conditional step for loading buffer (as potential source needs buffer lines to be up to date). That loading in turn also updated window-local foldmethod
option taking it from the current one (which is 'manual'
from the "main" log window). At step 7, that exact buffer is shown in the split and has different 'foldmethod' value.
I partially consider this behavior more due to the plugins which manage those buffers. Not only they trigger a BufEnter
event for unlisted and unloaded buffer, but they still keep that buffer around when completely removing it is a cleaner approach.
However, not auto enabling unlisted buffers looks (at the moment) like a better approach overall. And this fixes this particular issue.
Contributing guidelines
Module(s)
mini.diff
Description
I do not know if the
mini.diff
plugin causes this bug, or if it's thevim-flog
plugin. Whenmini.diff
is enabled, it affects thefoldmethod
option of the window opened byvim-flog
.Neovim version
v0.11.0-dev-236+g5def8714a
Steps to reproduce
nvim -nu minimal.lua
:Flogsplit
<CR>
to select one commit, the right window is foldable,foldmethod
of the window issyntax
<CR>
to select other commit, the right window is foldable,foldmethod
of the window issyntax
<CR>
to select the commit in step 5, the right window is not foldable,foldmethod
of the window ismanual
mini.diff
inminimal.lua
, the right window in step 7 is foldableExpected behavior
The right window in step 7 is foldable.
Actual behavior
step 5:
step 6:
step 7: