diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/applications/editors/neovim/tests/default.nix | 29 | ||||
-rw-r--r-- | pkgs/applications/editors/neovim/utils.nix | 1 |
2 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/applications/editors/neovim/tests/default.nix b/pkgs/applications/editors/neovim/tests/default.nix index 97c7a2505a5c0..14b6bdf2e375d 100644 --- a/pkgs/applications/editors/neovim/tests/default.nix +++ b/pkgs/applications/editors/neovim/tests/default.nix @@ -1,3 +1,4 @@ +# run tests by building `neovim.tests` { vimUtils, vim_configurable, writeText, neovim, vimPlugins , lib, fetchFromGitHub, neovimUtils, wrapNeovimUnstable , neovim-unwrapped @@ -66,6 +67,15 @@ let sha256 = "1ykcvyx82nhdq167kbnpgwkgjib8ii7c92y3427v986n2s5lsskc"; }; + # this plugin checks that it's ftplugin/vim.tex is loaded before $VIMRUNTIME/ftplugin/vim.tex + # the answer is store in `plugin_was_loaded_too_late` in the cwd + texFtplugin = pkgs.runCommandLocal "tex-ftplugin" {} '' + mkdir -p $out/ftplugin + echo 'call system("echo ". exists("b:did_ftplugin") . " > plugin_was_loaded_too_late")' > $out/ftplugin/tex.vim + echo ':q!' >> $out/ftplugin/tex.vim + echo '\documentclass{article}' > $out/main.tex + ''; + # neovim-drv must be a wrapped neovim runTest = neovim-drv: buildCommand: runCommandLocal "test-${neovim-drv.name}" ({ @@ -128,6 +138,25 @@ rec { ${nvim_with_plug}/bin/nvim -i NONE -c 'color base16-tomorrow-night' +quit! -e ''; + nvim_with_ftplugin = neovim.override { + extraName = "-with-ftplugin"; + configure.packages.plugins = with pkgs.vimPlugins; { + start = [ + texFtplugin + ]; + }; + }; + + # regression test that ftplugin files from plugins are loaded before the ftplugin + # files from $VIMRUNTIME + run_nvim_with_ftplugin = runTest nvim_with_ftplugin '' + export HOME=$TMPDIR + ${nvim_with_ftplugin}/bin/nvim ${texFtplugin}/main.tex + result="$(cat plugin_was_loaded_too_late)" + echo $result + [ "$result" = 0 ] + ''; + # check that the vim-doc hook correctly generates the tag # we know for a fact packer has a doc folder diff --git a/pkgs/applications/editors/neovim/utils.nix b/pkgs/applications/editors/neovim/utils.nix index cb0c005759b80..2af7ffb43943d 100644 --- a/pkgs/applications/editors/neovim/utils.nix +++ b/pkgs/applications/editors/neovim/utils.nix @@ -106,6 +106,7 @@ let flags = [ "--cmd" (lib.intersperse "|" hostProviderViml) "--cmd" "set packpath^=${vimUtils.packDir packDirArgs}" + "--cmd" "set rtp^=${vimUtils.packDir packDirArgs}" ]; in [ |