fix(lazyfile): exclude filetypedetect
from skips
#3004
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2891 (potentially)
After I saw that issue after a long a time, I decided to take a deeper dive to how
lazyfile
works.Unfortunately, with my lack of programming experience, I could only understand some things on the surface, so I ended up doing some
vim.print
to have some visual hints. I then noticed thatfiletypedetect
was given back fromEvent.get_augroups(event.event)
and included in theskips
table, which is later excluded inEvent.trigger
.My assumption was that due to
filetypedetect
being skipped, the filetypes added inextras.util.dot
could not be detected inLazyFile
event when Neovim was invoked with file arguments, as also stated in the aforementioned issue.So, I just tried to exclude
filetypedetect
from being added toskips
table and when I tested it locally it worked when invoking Neovim with file arguments.I would love some input from the maintainer, as the steps I followed were mostly based on logical deductions, rather having in-depth knowledge of what's actually going on in the
lazyfile
function and the maintainer is obviously the one most intrinsically acquainted with LazyVim codebase and obviously there might be a more correct way to do it.