From 688e5c85b7537f308b82167c8eb4ecfb70a49861 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Mon, 15 Aug 2022 08:41:57 -0600 Subject: [PATCH] neovim: fix tests (#3147) https://github.com/NixOS/nixpkgs/pull/184364 broke the tests Closes #3146 Signed-off-by: Sumner Evans --- modules/programs/neovim.nix | 19 ++++--------------- .../modules/programs/neovim/plugin-config.vim | 6 ------ 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index 6308dba1..ced4a39a 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -55,15 +55,6 @@ let }; }; - # A function to get the configuration string (if any) from an element of 'plugins' - pluginConfig = p: - if p ? plugin && (p.config or "") != "" then '' - " ${p.plugin.pname or p.plugin.name} {{{ - ${p.config} - " }}} - '' else - ""; - allPlugins = cfg.plugins ++ optional cfg.coc.enable { type = "viml"; plugin = cfg.coc.package; @@ -394,12 +385,10 @@ in { home.packages = [ cfg.finalPackage ]; xdg.configFile."nvim/init.vim" = mkIf (neovimConfig.neovimRcContent != "") { - text = if hasAttr "lua" config.programs.neovim.generatedConfigs then - neovimConfig.neovimRcContent + '' - - lua require('init-home-manager')'' - else - neovimConfig.neovimRcContent; + text = neovimConfig.neovimRcContent + (optionalString + (hasAttr "lua" config.programs.neovim.generatedConfigs) '' + lua require('init-home-manager') + ''); }; xdg.configFile."nvim/lua/init-home-manager.lua" = mkIf (hasAttr "lua" config.programs.neovim.generatedConfigs) { diff --git a/tests/modules/programs/neovim/plugin-config.vim b/tests/modules/programs/neovim/plugin-config.vim index 89278a0a..ee45a863 100644 --- a/tests/modules/programs/neovim/plugin-config.vim +++ b/tests/modules/programs/neovim/plugin-config.vim @@ -1,10 +1,4 @@ -set packpath^=/nix/store/00000000000000000000000000000000-vim-pack-dir -set runtimepath^=/nix/store/00000000000000000000000000000000-vim-pack-dir - -" vim-commentary {{{ " This should be present too autocmd FileType c setlocal commentstring=//\ %s autocmd FileType c setlocal comments=:// - -" }}} " This should be present in vimrc