vim-utils: Handle overriding knownPlugins betters.

This commit is contained in:
Evan Danaher 2017-03-19 18:44:02 -04:00
parent 16fff5ebce
commit c34aa75d30

View File

@ -412,11 +412,16 @@ rec {
} // a); } // a);
requiredPlugins = { requiredPlugins = {
knownPlugins ? vimPlugins, givenKnownPlugins ? null,
vam ? null, vam ? null,
pathogen ? null, ... pathogen ? null, ...
}: }:
let 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; }); pathogenNames = map (name: knownPlugins.${name}) (findDependenciesRecursively { inherit knownPlugins; names = pathogen.pluginNames; });
vamNames = findDependenciesRecursively { inherit knownPlugins; names = lib.concatMap toNames vam.pluginDictionaries; }; vamNames = findDependenciesRecursively { inherit knownPlugins; names = lib.concatMap toNames vam.pluginDictionaries; };
names = (lib.optionals (pathogen != null) pathogenNames) ++ names = (lib.optionals (pathogen != null) pathogenNames) ++