You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All one has to do is to trap BufNew and if it's isdirectory() then set up BufReadCmd for this particular buffer. No need to add any extra autocommands.
No VimEnter. It is enough to iterate through all pre-loaded buffers once on plugin startup.
I've no idea why everyone likes to pollute BufEnter. In my implementation I go without it.
P.S. The only problem I'm aware of that might force usage of BufEnter or similar is that some window-local options might not be synchronized properly. Suppose you have one directory buffer opened in several different windows. Then &concealcursor or such may be not set in some of them. This is unfortunate but kind of expected, as long as we're doing only "per buffer init" and never "per window init". Personally, I opted just to ignore that small issue.
The text was updated successfully, but these errors were encountered:
Use simpler approach suggested by @matveyt vim/vim#16259 (comment)
caveat?:
The text was updated successfully, but these errors were encountered: