Closed Willem-J-an closed 1 year ago
ufo doesn't attach the buffer at once, so buffer is unattached in BufEnter
.
https://github.com/kevinhwang91/nvim-ufo/blob/9e829d5cfa3de6a2ff561d86399772b0339ae49d/lua/ufo/fold/init.lua#L29-L30
You need to make sure that buffer is attached if you invoke API.
https://github.com/kevinhwang91/nvim-ufo/blob/9e829d5cfa3de6a2ff561d86399772b0339ae49d/doc/example.lua#L113-L125
Feature description
I want to require("ufo").closeAllFolds when I open a file. I tried to use an autocmd like so:
But this happens for every BufEnter, not just the initial one. The other autocmd's don't seem to work. I'm probably overlooking something obvious.
Describe the solution you'd like
A way to configure auto close for specific file types upon initial opening of the buffer.
Additional context
Hope you have some guidance on this, thanks a lot!