mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
vimUtils: fix requiredPlugins
I broke this in #52767 and didn't notice because I only tested with vim and `requiredPlugins` is only used by neovim. This would break setups that use string-plugins (like pathogen) with neovim.
This commit is contained in:
parent
f8ff164806
commit
093cfde1e0
|
@ -1,4 +1,4 @@
|
|||
{stdenv, vim, vimPlugins, vim_configurable, buildEnv, writeText, writeScriptBin
|
||||
{stdenv, vim, vimPlugins, vim_configurable, neovim, buildEnv, writeText, writeScriptBin
|
||||
, nix-prefetch-hg, nix-prefetch-git }:
|
||||
|
||||
/*
|
||||
|
@ -407,6 +407,7 @@ rec {
|
|||
|
||||
inherit (import ./build-vim-plugin.nix { inherit stdenv rtpPath vim; }) buildVimPlugin buildVimPluginFrom2Nix;
|
||||
|
||||
# used to figure out which python dependencies etc. neovim needs
|
||||
requiredPlugins = {
|
||||
packages ? {},
|
||||
givenKnownPlugins ? null,
|
||||
|
@ -420,11 +421,11 @@ rec {
|
|||
if vam != null && vam ? knownPlugins then vam.knownPlugins else
|
||||
if pathogen != null && pathogen ? knownPlugins then pathogen.knownPlugins else
|
||||
vimPlugins;
|
||||
pathogenNames = findDependenciesRecursively knownPlugins pathogen.pluginNames;
|
||||
vamNames = findDependenciesRecursively knownPlugins (lib.concatMap vamDictToNames vam.pluginDictionaries);
|
||||
names = (lib.optionals (pathogen != null) pathogenNames) ++
|
||||
(lib.optionals (vam != null) vamNames);
|
||||
nonNativePlugins = map (name: knownPlugins.${name}) names ++ (lib.optionals (plug != null) plug.plugins);
|
||||
pathogenPlugins = findDependenciesRecursively knownPlugins pathogen.pluginNames;
|
||||
vamPlugins = findDependenciesRecursively knownPlugins (lib.concatMap vamDictToNames vam.pluginDictionaries);
|
||||
nonNativePlugins = (lib.optionals (pathogen != null) pathogenPlugins)
|
||||
++ (lib.optionals (vam != null) vamPlugins)
|
||||
++ (lib.optionals (plug != null) plug.plugins);
|
||||
nativePluginsConfigs = lib.attrsets.attrValues packages;
|
||||
nativePlugins = lib.concatMap ({start?[], opt?[], knownPlugins?vimPlugins}: start++opt) nativePluginsConfigs;
|
||||
in
|
||||
|
@ -451,4 +452,9 @@ rec {
|
|||
name = "vim-with-vim-addon-nix";
|
||||
vimrcConfig.packages.myVimPackage.start = with vimPlugins; [ vim-nix ];
|
||||
};
|
||||
|
||||
# only neovim makes use of `requiredPlugins`, test this here
|
||||
test_nvim_with_vim_nix_using_pathogen = neovim.override {
|
||||
configure.pathogen.pluginNames = [ "vim-nix" ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue