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:
parent
dc6d0a504e
commit
5cf11c44fe
1 changed files with 8 additions and 2 deletions
|
@ -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}"
|
printf "%s\n" "echo -markup %{{Information}'$kak_opt_fzf_tag_file_name' file found at $HOME. Check if it is right tag file}"
|
||||||
fi
|
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
|
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
|
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
|
fi
|
||||||
|
|
||||||
message="Jump to a symbol''s definition
|
message="Jump to a symbol''s definition
|
||||||
|
|
Loading…
Reference in a new issue