From 9cb5337fde7c530df0cfbea514ffb17842501654 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Thu, 7 Oct 2021 22:26:43 +0000 Subject: [PATCH] vim-utils: fix dependency graph (#140118) * neovim.tests: ensure the graph is pulled We'll change the plugin name to ensure the plugin is correctly pulled by vim-plug config generation. * neovim.tests: ensure nvim exit with error * Revert "fix: remove trailing '/.' from vim-plug plugin paths" The root cause if fixed by https://github.com/nixOS/nixpkgs/commit/761b2c6ff342425388db38b86f1c49cbdb232514#diff-e4b94db9201d58bd9410739dddf92bef74e0b5f5e596c804a84ee7c580ae3f71R9 This reverts commit d9d1a11aed1761bc3a9d95dd2b8d154c44d4feec. --- pkgs/applications/editors/neovim/tests.nix | 4 ++-- pkgs/misc/vim-plugins/vim-utils.nix | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/editors/neovim/tests.nix b/pkgs/applications/editors/neovim/tests.nix index 085fceac1108..1e46a59f563b 100644 --- a/pkgs/applications/editors/neovim/tests.nix +++ b/pkgs/applications/editors/neovim/tests.nix @@ -87,7 +87,7 @@ rec { nvim_with_plug = neovim.override { extraName = "-with-plug"; configure.plug.plugins = with pkgs.vimPlugins; [ - base16-vim + (base16-vim.overrideAttrs(old: { pname = old.pname + "-unique-for-tests-please-dont-use"; })) ]; configure.customRC = '' color base16-tomorrow-night @@ -97,7 +97,7 @@ rec { run_nvim_with_plug = runTest nvim_with_plug '' export HOME=$TMPDIR - ${nvim_with_plug}/bin/nvim -i NONE -c 'color base16-tomorrow-night' +quit! + ${nvim_with_plug}/bin/nvim -i NONE -c 'color base16-tomorrow-night' +quit! -e ''; diff --git a/pkgs/misc/vim-plugins/vim-utils.nix b/pkgs/misc/vim-plugins/vim-utils.nix index 60b9b60806d5..01c32b2a3996 100644 --- a/pkgs/misc/vim-plugins/vim-utils.nix +++ b/pkgs/misc/vim-plugins/vim-utils.nix @@ -292,14 +292,12 @@ let /* vim-plug is an extremely popular vim plugin manager. */ - /* Remove repeated "/." suffixes from a path */ - stripDots = path: lib.head (builtins.split "(/\\.)*$" path); plugImpl = ('' source ${vimPlugins.vim-plug.rtp}/plug.vim silent! call plug#begin('/dev/null') - '' + (lib.concatMapStringsSep "\n" (pkg: "Plug '${stripDots pkg.rtp}'") plug.plugins) + '' + '' + (lib.concatMapStringsSep "\n" (pkg: "Plug '${pkg.rtp}'") plug.plugins) + '' call plug#end() '');