Closed spflaumer closed 5 months ago
It seems that the issue is of an entirely different kind... as it turns out, something silences all prints. Writing something to a global variable does in fact alter it's contents on BufEnter. Reading the code for all BufEnter autocmds created by oil didn't really reveal why
I have encountered this problem before (missing prints in autocmds), though not in relation to oil specifically. I wish I had made more of a note of it, but I think I just worked around it and moved on. This is almost certainly either a bug or a weird interaction in Neovim itself. The thing to do here would be to try to get a more minimal repro (without using oil) and file it upstream on Neovim.
May I know more about the workaround? There is an issue where the autocmd BufNewFile hook does not work when creating a new file in oil buffer, causing the inability to use skeleton files.
Found one from closed issue, never mind. https://github.com/stevearc/oil.nvim/issues/49#issuecomment-1407567002
Dug into it more, and found a fix in #348
Did you check the docs and existing issues?
Neovim version (nvim -v)
NVIM v0.9.5
Operating system/version
Void Linux x86_64 (musl)
Describe the bug
When opening a file from oil,
no BufEnter autocmds are triggered.any prints by autocmds are silenced. Using netrw yields the exact opposite result, consistentlytriggering the BufEnter autocmds, prints from BufEnter autocmds. The same applies to other plugins (telescope.nvim) and the :edit command (even when oil is loaded). Trying to circumvent this issue by creating a custom mapping for the select action, using a callback that triggers the select action and then manually the BufEnter event, doesn't help; nothing from BufEnter autocmds is printed.What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
Expected Behavior
All BufEnter autocmds are ran
Directory structure
./foo.txt ./repro.lua
Repro
Did you check the bug with a clean config?
nvim -u repro.lua
using the repro.lua file above.