anchor.diff:  let
     inherit (stdenv) lib;
   
  -  # transitive closure of plugin dependencies
  -  transitiveClosure = knownPlugins: plugin:
  -  let
  -    # vam puts out a list of strings as the dependency list, we need to be able to deal with that.
  -    # Because of that, "plugin" may be a string or a derivation. If it is a string, it is resolved
  -    # using `knownPlugins`. Otherwise `knownPlugins` can be null.
  -    knownPlugins' = if knownPlugins == null then vimPlugins else knownPlugins;
  -    pluginDrv = if builtins.isString plugin then knownPlugins'.${plugin} else plugin;
  -  in
  -    [ pluginDrv ] ++ (
  -      lib.unique (builtins.concatLists (map (transitiveClosure knownPlugins) pluginDrv.dependencies or []))
  +  # make sure a plugin is a derivation. If plugin already is a derivation, this
  +  # is a no-op. If it is a string, it is looked up in knownPlugins.
  +  pluginToDrv = knownPlugins: plugin:
  +    if builtins.isString plugin then
  +      # make sure `pname` is set to that we are able to convert the derivation
  +      # back to a string.
  +      ( knownPlugins.${plugin} // { pname = plugin; })
  +    else
  +      plugin;
  +
  +  # transitive closure of plugin dependencies (plugin needs to be a derivation)
  +  transitiveClosure = plugin:
  +    [ plugin ] ++ (
  +      lib.unique (builtins.concatLists (map transitiveClosure plugin.dependencies or []))
       );
   
  -  findDependenciesRecursively = knownPlugins: plugins: lib.concatMap (transitiveClosure knownPlugins) plugins;
  +  findDependenciesRecursively = plugins: lib.concatMap transitiveClosure plugins;
   
     attrnamesToPlugins = { knownPlugins, names }:
       map (name: if builtins.isString name then knownPlugins.${name} else name) knownPlugins;
  
positive.code:   test_nvim_with_vim_nix_using_pathogen = neovim.override {
      configure.pathogen.pluginNames = [ "vim-nix" ];
    };
  }
  
negative.code:           # opposed to older implementations that have to maintain backwards
            # compatibility). Therefore we don't need to deal with "knownPlugins"
            # and can simply pass `null`.
            depsOfOptionalPlugins = lib.subtractLists opt (findDependenciesRecursively opt);
            startWithDeps = findDependenciesRecursively start;
          in
            ["mkdir -p $out/pack/${packageName}/start"]
            # To avoid confusion, even dependencies of optional plugins are added
  