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
As this comment on another plugin's issue tracker points out, there is no need to do this, as Vim already opens an augroup filetypedetect context before running ftdetect scripts.
But doing so in your own ftdetect script is not just useless, it's actually harmful to other ftdetect scripts that do rely on being run inside of an augroup filetypedetect context: By leaving this context at the end of your script, you stop all those scripts from working properly, as happened in hashivim/vim-terraform#179.
It's worth pointing out that out of the many plugins I have installed, vimoutliner is the only one that does this:
I don't know if you introduced this as a defensive measure against another popular script doing the same thing (and hence messing it up for other scripts including vimoutliner), but if so, then it would probably be better to just specify the filetypedetect group explicitly for every single autocmd command or to not leave the augroup context at the end of the script.
Objections / thoughts?
The text was updated successfully, but these errors were encountered:
It is both pointless and introduces bugs, as Vim opens an augroup
filetypedetect context before running ftdetect scripts anyway and other
ftdetect scripts rely on being inside such a context, so by leaving it
at the end of our ftdetect script we break them.
Fixesvimoutliner#185
The
ftdetect
script for .votl files that comes with this plugin is currently nested inside anaugroup filetypedetect ... augroup END
block:vimoutliner/ftdetect/votl.vim
Lines 22 to 25 in 6d849ac
As this comment on another plugin's issue tracker points out, there is no need to do this, as Vim already opens an
augroup filetypedetect
context before runningftdetect
scripts.But doing so in your own
ftdetect
script is not just useless, it's actually harmful to otherftdetect
scripts that do rely on being run inside of anaugroup filetypedetect
context: By leaving this context at the end of your script, you stop all those scripts from working properly, as happened in hashivim/vim-terraform#179.It's worth pointing out that out of the many plugins I have installed,
vimoutliner
is the only one that does this:I don't know if you introduced this as a defensive measure against another popular script doing the same thing (and hence messing it up for other scripts including vimoutliner), but if so, then it would probably be better to just specify the
filetypedetect
group explicitly for every singleautocmd
command or to not leave theaugroup
context at the end of the script.Objections / thoughts?
The text was updated successfully, but these errors were encountered: