1
0
Fork 0

partly fix #75

This commit is contained in:
Andrey Orst 2019-12-19 11:44:05 +03:00
parent 16a083cb69
commit ec506b5b9b

View file

@ -24,11 +24,11 @@ map global fzf-vcs -docstring "edit file from Git tree" 'g' '<esc>: fzf-git<ret>
define-command -override -hidden fzf-git %{ evaluate-commands %sh{
case $kak_opt_fzf_git_command in
(git) cmd='repo_root=$(git rev-parse --show-toplevel); git ls-tree --full-tree --name-only -r HEAD | awk "{print \"$repo_root/\" \$0}"' ;;
(git*) cmd=$kak_opt_fzf_git_command ;;
(git) cmd='git ls-tree --full-tree --name-only -r HEAD' ;;
(*) cmd=$kak_opt_fzf_git_command ;;
esac
[ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect $kak_opt_fzf_vertical_map --expect $kak_opt_fzf_horizontal_map"
printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags}"
printf "%s\n" "fzf -kak-cmd %{edit -existing} -items-cmd %{$cmd} -fzf-args %{-m --expect $kak_opt_fzf_window_map $additional_flags} -filter %{perl -pe \"if (/$kak_opt_fzf_window_map|$kak_opt_fzf_vertical_map|$kak_opt_fzf_horizontal_map|^$/) {} else {print \\\"$(git rev-parse --show-toplevel)/\\\"}\"}"
}}
§