From c34aa75d30ce5d74d773210f97e0d43daf5c3a6b Mon Sep 17 00:00:00 2001 From: Evan Danaher Date: Sun, 19 Mar 2017 18:44:02 -0400 Subject: [PATCH] vim-utils: Handle overriding knownPlugins betters. --- pkgs/misc/vim-plugins/vim-utils.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/vim-plugins/vim-utils.nix b/pkgs/misc/vim-plugins/vim-utils.nix index 22098b68a558..87b2f9d3e188 100644 --- a/pkgs/misc/vim-plugins/vim-utils.nix +++ b/pkgs/misc/vim-plugins/vim-utils.nix @@ -412,11 +412,16 @@ rec { } // a); requiredPlugins = { - knownPlugins ? vimPlugins, + givenKnownPlugins ? null, vam ? null, pathogen ? null, ... }: let + # This is probably overcomplicated, but I don't understand this well enough to know what's necessary. + knownPlugins = if givenKnownPlugins != null then givenKnownPlugins else + if vam != null && vam ? knownPlugins then vam.knownPlugins else + if pathogen != null && pathogen ? knownPlugins then pathogen.knownPlugins else + vimPlugins; pathogenNames = map (name: knownPlugins.${name}) (findDependenciesRecursively { inherit knownPlugins; names = pathogen.pluginNames; }); vamNames = findDependenciesRecursively { inherit knownPlugins; names = lib.concatMap toNames vam.pluginDictionaries; }; names = (lib.optionals (pathogen != null) pathogenNames) ++