Open MagicDuck opened 3 weeks ago
Note, in case it helps debug the issue, this works as a workaround but has the side effect of cursor flickering if calculating folds for lots of lines:
local currentWin = vim.api.nvim_get_current_win()
vim.api.nvim_set_current_win(win)
vim.api.nvim_feedkeys(
-- note: if in insert mode, <C-\><C-o> does a normal mode command without moving cursor
-- see help ins-special-special
vim.api.nvim_replace_termcodes('<c-\\><c-o><cmd>normal zx<cr>', true, false, true),
'n',
false
)
vim.api.nvim_set_current_win(currentWin)
I've also tried using vim._foldupdate(win, start, end)
as a workaround but it seems to do nothing...
note that this affects grug-far.nvim
plugin. This line:
https://github.com/MagicDuck/grug-far.nvim/blob/ebab68b2150079732ae8074eefb261a124824139/lua/grug-far/fold.lua#L18
Workaround is to pass the following to wk.setup()
:
disable = {
ft = { 'grug-far' },
},
Did you check docs and existing issues?
Neovim version (nvim -v)
0.10.0
Operating system/version
MacOS 14.6.1
Describe the bug
This appears to be a regression with V3 which-key version. In previous versions,
vim.fn.win_execute(win, 'normal zx')
would work. It also works if I completely comment out which-key plugin setup.Steps To Reproduce
=vim.fn.win_getid()
to get the window id, ex result:1067
zf
zo
:lua vim.fn.win_execute(1067, 'normal zx')
Notice that nothing happens. If you instead do other things like
:lua vim.fn.win_execute(1067, 'normal 5j')
that works!Expected Behavior
the fold should collapse. As it does if you execute
zx
in normal mode from the first window.Health
Log
Repro
Note: this is my full config: