kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.18k stars 38 forks source link

Is there a way to lazy load this plugin properly? #81

Closed registerGen closed 1 year ago

registerGen commented 1 year ago

Feature description

I'd like to lazy load this plugin on autocmds (Specifically, BufReadPre) but this doesn't work only on the very first buffer attached because of https://github.com/kevinhwang91/nvim-ufo/issues/47#issuecomment-1184050737.

Describe the solution you'd like

Detect whether there exists a loaded buffer when this plugin is being loaded and handle this case properly.

Additional context

No response

registerGen commented 1 year ago

Oh I didn't notice the new comments on #47... Simply using BufRead instead resolves this.

Sorry :(