Skip to content

Commit 4d7ec07

Browse files
committed
neovim: restore provider configuration in legacy mode
We used to unconditionnally wrap the provider configuration. NixOS#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.
1 parent 9a25c8c commit 4d7ec07

3 files changed

Lines changed: 22 additions & 13 deletions

File tree

doc/release-notes/rl-2605.section.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
- `openrgb` was updated to 1.0rc2, which now uses Plugin API version 4.
243243
Some existing OpenRGB plugins may be incompatible or require updates.
244244
245-
- 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.
245+
- `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`.
246246
247247
- We now use the upstream wrapper script for Gradle, supporting both the `JAVA_HOME` and `GRADLE_OPTS` environment variables.
248248

pkgs/applications/editors/neovim/utils.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ let
223223
res
224224
// {
225225
wrapperArgs = lib.escapeShellArgs res.wrapperArgs + " " + extraMakeWrapperArgs;
226-
wrapRc = (configure != { });
226+
wrapRc = configure != { };
227+
legacyWrapper = true;
227228
}
228229
);
229230

pkgs/applications/editors/neovim/wrapper.nix

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,25 @@ let
130130
wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs;
131131

132132
generatedWrapperArgs =
133-
lib.optionals
134-
(
135-
finalAttrs.packpathDirs.myNeovimPackages.start != [ ]
136-
|| finalAttrs.packpathDirs.myNeovimPackages.opt != [ ]
137-
)
138-
[
139-
"--add-flags"
140-
''--cmd "set packpath^=${finalPackdir}"''
141-
"--add-flags"
142-
''--cmd "set rtp^=${finalPackdir}"''
143-
]
133+
134+
# neovimUtils.legacyWrapper adds a `legacyWrapper` attribute to let us know we run in "legacy" mode
135+
lib.optionals (attrs ? legacyWrapper) [
136+
# vim accepts a limited number of commands so we join all the provider ones
137+
"--add-flags"
138+
''--cmd "lua ${providerLuaRc}"''
139+
]
140+
++
141+
lib.optionals
142+
(
143+
finalAttrs.packpathDirs.myNeovimPackages.start != [ ]
144+
|| finalAttrs.packpathDirs.myNeovimPackages.opt != [ ]
145+
)
146+
[
147+
"--add-flags"
148+
''--cmd "set packpath^=${finalPackdir}"''
149+
"--add-flags"
150+
''--cmd "set rtp^=${finalPackdir}"''
151+
]
144152
++ lib.optionals finalAttrs.withRuby [
145153
"--set"
146154
"GEM_HOME"

0 commit comments

Comments
 (0)