1
0
Fork 0

fzf-ctags: Check for readtags command

Not every universal ctags package out there comes with the `readtags` command.
Therefore, it was a bit tedious to figure out why fzf-ctags didn't work. With
this change fzf-ctags will abort if readtags doesn't exist.
This commit is contained in:
robem 2020-03-17 18:12:42 -07:00
parent dc6d0a504e
commit 5cf11c44fe

View file

@ -808,10 +808,16 @@ define-command -hidden fzf-tag -params ..2 %{ evaluate-commands %sh{
printf "%s\n" "echo -markup %{{Information}'$kak_opt_fzf_tag_file_name' file found at $HOME. Check if it is right tag file}"
fi
readtags_cmd="readtags"
if [ ! $(command -v ${readtags_cmd}) ]; then
printf "%s\n" "echo -markup %{{Information}'${readtags_cmd}' executable not found. Check if '${readtags_cmd} is installed}"
exit
fi
if [ -n "$1" ]; then
cmd="cd $path; readtags -t $kak_opt_fzf_tag_file_name -Q '(eq? \$kind \"$1\")' -l | cut -f1"
cmd="cd $path; ${readtags_cmd} -t $kak_opt_fzf_tag_file_name -Q '(eq? \$kind \"$1\")' -l | cut -f1"
else
cmd="cd $path; readtags -t $kak_opt_fzf_tag_file_name -l | cut -f1"
cmd="cd $path; ${readtags_cmd} -t $kak_opt_fzf_tag_file_name -l | cut -f1"
fi
message="Jump to a symbol''s definition