tig: fix zsh completion

The ZSH completion script of `tig` basically imports the bash completion
script and uses it as completion approach. Unfortunately the script
takes several assumptions about the directory structure using
`$funcsourcetrace`[1] that don't apply on NixOS.

The easiest workaround is t opatch the completion script and import the
bash completion script from `$out`.

[1] http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#index-funcsourcetrace
This commit is contained in:
Maximilian Bosch 2018-09-23 19:36:22 +02:00
parent 9fee74d616
commit 4bf1a7d975
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -31,6 +31,10 @@ stdenv.mkDerivation rec {
installPhase = ''
make install
make install-doc
substituteInPlace contrib/tig-completion.zsh \
--replace 'e=$(dirname ''${funcsourcetrace[1]%:*})/tig-completion.bash' "e=$out/etc/bash_completion.d/tig-completion.bash"
install -D contrib/tig-completion.bash $out/etc/bash_completion.d/tig-completion.bash
install -D contrib/tig-completion.zsh $out/share/zsh/site-functions/_tig
cp contrib/vim.tigrc $out/etc/