Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get scripts/build working again, make the tests pass #844

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

00dani
Copy link

@00dani 00dani commented Oct 10, 2023

I noticed there hasn't been an update to vim-polyglot in about a year, and that the test suite was failing, so I figured I'd try to fix both issues. There were some obvious issues, like calling File.exists? rather than File.exist? in the build script, but I've made some somewhat more drastic changes as well.

Most notably, all native packages aren't copied into vim-polyglot itself any more, because that causes conflicts between the version supplied by Vim and the version supplied by vim-polyglot. For example, running :setf ada with the mainline version of vim-polyglot will error, because Vim will load both its own version of the Ada plugin and vim-polyglot's version, and that plugin uses :lockvar so you get a crash.

I've also tweaked the test suite slightly to make it more robust, and I've taught generate_ftdetect to include suitable autocommands for filetypes Vim natively knows about but vim-polyglot does not, such as Factor, Hack, and Twig.

Finally I ran a build and committed the updated vim-polyglot, which now passes all its tests.

This is one of the more drastic changes to the build process, but it
seems to be a good one. Having two copies of the same filetype can cause
a variety of problems since Vim tries to load both of them - for
example, :setf ada will error if you have mainline vim-polyglot
installed, because the Ada autoload file uses :lockvar. Not copying the
filetype support that's bundled with Vim already prevents that collision
issue.

This change also means you can immediately get the latest version of the
natively-supported filetypes if you keep your Vim up to date, while the
version bundled into vim-polyglot is still pinned at v8.2.4274 for
compatibility reasons. (I did try bumping up that version number, but
you end up getting Vim9 script, which will break vim-polyglot on older
Vims.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant