Closed nfischer closed 3 years ago
@dbarnett This seems to work correctly for vim 8.1.2269 (the particular test case I had issues with passes, as do all the other vroom test cases I'm aware of). Can you advise on how to check availability of the '--clean' switch? Is there an easy way to check the vim version?
Can you advise on how to check availability of the '--clean' switch? Is there an easy way to check the vim version?
I would suggest to always attempt to start with --clean
but on errors fall back to running without --clean
. That way in the common case there's no overhead.
Alternatives would be to always run vim --version
first (guaranteed overhead, and could have gotchas trying to check that way anyway), or to accept new --clean
and --noclean
args in vroom that the caller has to configure correctly (awkward for users and still takes effort to implement).
PTAL. It looks like the default wait time is 500ms which is more than enough for vim to recognize unknown switches. I tested this locally by changing --clean
to --someunknownarg
(to force this error case) and the fallback code worked as expected 10/10.
That'll do the trick! Thanks!
Merging.
This uses vim's '--clean' switch to avoid loading ftplugins, since this can affect behavior during vroom tests. This switch seems to avoid the issue in my local testing, whereas other things ('-i NONE', '--noplugin', etc.) don't seem to have the same effect.
I can't get vroom running in '--neovim' mode (nvim 0.4.4), so this doesn't attempt to address the issue in the neovim code path. neovim appears to define '--clean' differently from vim, so it's possible neovim may require a different fix.
I verified this still respects vroom's '--vimrc' switch while having the desired behavior of avoiding plugins.
Fixes #105