Commit 4d7ec078 authored by teto's avatar teto
Browse files

neovim: restore provider configuration in legacy mode

We used to unconditionnally wrap the provider configuration.
https://github.com/NixOS/nixpkgs/pull/487390 "smartly" embeds it into
init.lua depending on `wrapRc` but that breaks neovim legacy behavior in some cases since `legacyWrapper` sets `wrapRc` to false in absence of some of user configuration.
One day we will get rid of the legacy wrapper but until then keep that behavior.

Most of the changes come from linter.
parent 9a25c8c8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@
- `openrgb` was updated to 1.0rc2, which now uses Plugin API version 4.
  Some existing OpenRGB plugins may be incompatible or require updates.

- the `neovim` wrapper sets provider-related configuration in its generated config rather than as wrapper arguments. It should not affect configuration unless you set `wrapRc` to false.
- `wrapNeovimUnstable` now sets provider-related configuration in its generated config rather than as wrapper arguments. It should not affect configuration unless you set `wrapRc` to false or are using the `legacyWrapper`.

- We now use the upstream wrapper script for Gradle, supporting both the `JAVA_HOME` and `GRADLE_OPTS` environment variables.

+2 −1
Original line number Diff line number Diff line
@@ -223,7 +223,8 @@ let
      res
      // {
        wrapperArgs = lib.escapeShellArgs res.wrapperArgs + " " + extraMakeWrapperArgs;
        wrapRc = (configure != { });
        wrapRc = configure != { };
        legacyWrapper = true;
      }
    );

+19 −11
Original line number Diff line number Diff line
@@ -130,6 +130,14 @@ let
        wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs;

        generatedWrapperArgs =

          # neovimUtils.legacyWrapper adds a `legacyWrapper` attribute to let us know we run in "legacy" mode
          lib.optionals (attrs ? legacyWrapper) [
            # vim accepts a limited number of commands so we join all the provider ones
            "--add-flags"
            ''--cmd "lua ${providerLuaRc}"''
          ]
          ++
            lib.optionals
              (
                finalAttrs.packpathDirs.myNeovimPackages.start != [ ]