sheerun / vim-polyglot

A solid language pack for Vim.
5.6k stars 295 forks source link

Polyglot overrides newer ftplugins that ship with vim #845

Open idbrii opened 10 months ago

idbrii commented 10 months ago

Does this bug happen when you install plugin without vim-polyglot? No, it's because polyglot bundles ftplugins that are included with vim.

Readme says:

On top of all language packs from vim repository, vim-polyglot includes...

Describe the bug:

When I upgrade vim it gets new syntax and ftplugin files, but since user plugins load before vim runtime files the polyglot version is preferred. So my ftplugin files will be using the old polyglot version.

I can upgrade polyglot to solve, but I've had several issues upgrading polyglot that broke my workflow so it doesn't feel safe to upgrade without carefully checking the change log. (Automatic indent detection was a notable one since I already have DetectIndent and editorconfig and I think polyglot overrode their behaviour. I think Sensible was another fiasco since I see I've disabled that too.)

To Reproduce:

Install latest vim. Install polyglot c96947b1c64c56f70125a9bac9c006f69e45d5d3.

Create test.story:

Feature: Guess the word
  Rule: Only 5 guesses

  # The first example has two steps
  Scenario: Maker starts a game
    When the Maker starts a game
    Then the Maker waits for a Breaker to join

It looks like this: polyglot

but should look like this with Rule highlighted: vim latest with Rule highlighted

Suggestions:

Provide a way to disable polyglot's copy of vim's language packs or grab the version of vim they're copied from and automatically disable if the user's version of vim is newer.

rodrigoaguilera commented 3 weeks ago

Same problem with neovim. editorconfig come built-in after neovim 0.9 and vim-polyglot overrided indent configuration. In my case I had lua files with 2 spaces indent defined in the .editorconfig file and polyglot sets shiftwidth to 4.