diff --git a/doc/release-notes/rl-2605.section.md b/doc/release-notes/rl-2605.section.md index 8e6eaccf150f..537164f40301 100644 --- a/doc/release-notes/rl-2605.section.md +++ b/doc/release-notes/rl-2605.section.md @@ -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. diff --git a/pkgs/applications/editors/neovim/utils.nix b/pkgs/applications/editors/neovim/utils.nix index df9411ca269d..57ab04f98308 100644 --- a/pkgs/applications/editors/neovim/utils.nix +++ b/pkgs/applications/editors/neovim/utils.nix @@ -223,7 +223,8 @@ let res // { wrapperArgs = lib.escapeShellArgs res.wrapperArgs + " " + extraMakeWrapperArgs; - wrapRc = (configure != { }); + wrapRc = configure != { }; + legacyWrapper = true; } ); diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index f76410f6aa50..c3ec13eec25d 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -130,17 +130,25 @@ let wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs; generatedWrapperArgs = - lib.optionals - ( - finalAttrs.packpathDirs.myNeovimPackages.start != [ ] - || finalAttrs.packpathDirs.myNeovimPackages.opt != [ ] - ) - [ - "--add-flags" - ''--cmd "set packpath^=${finalPackdir}"'' - "--add-flags" - ''--cmd "set rtp^=${finalPackdir}"'' - ] + + # 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 != [ ] + || finalAttrs.packpathDirs.myNeovimPackages.opt != [ ] + ) + [ + "--add-flags" + ''--cmd "set packpath^=${finalPackdir}"'' + "--add-flags" + ''--cmd "set rtp^=${finalPackdir}"'' + ] ++ lib.optionals finalAttrs.withRuby [ "--set" "GEM_HOME"