1
0
Fork 0

fix bug with tmux, add label to info message

This commit is contained in:
Andrey Orst 2018-10-14 00:14:40 +03:00
parent 9f5a028112
commit b1b68b1381

View file

@ -1569,27 +1569,29 @@ define-command -hidden fzf-tag-kind -params ..1 %{ evaluate-commands %sh{
esac
if [ ! -z "$1" ]; then
mode=$(echo "$additional_message" | grep "<a-$1>:" | awk '{$1=""; print}' | sed "s/\(.*\)/:\1/")
cmd="readtags -Q '(eq? \$kind $1)' -l | cut -f1"
else
cmd="readtags -l | cut -f1"
fi
[ ! -z "${kak_client_env_TMUX}" ] && additional_keybindings="
[ ! -z "${kak_client_env_TMUX}" ] && tmux_keybindings="
<c-s>: open tag in horizontal split
<c-v>: open tag in vertical split"
message="Jump to a symbol''s definition.<ret>: open tag in new buffer.
message="Jump to a symbol''s definition
<ret>: open tag in new buffer
<c-w>: open tag in new window"
[ ! -z "$additional_message" ] && message="$message
[ ! -z "$additional_message" ] && message="$message $tmux_keybindings
Additional filters for $kak_opt_filetype: $additional_message"
echo "info -title 'fzf tag' '$message'"
echo "info -title 'fzf tag$mode' '$message'"
[ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect ctrl-v --expect ctrl-s"
eval echo 'fzf-tag \"ctags-search \$1\" \"$cmd\" \"--expect ctrl-w $additional_keybindings $additional_flags\"'
eval echo 'fzf-tag \"ctags-search \$1\" \"$cmd\" \"--expect ctrl-w $additional_flags $additional_keybindings\"'
}}
define-command -hidden fzf-tag -params 2..3 %{ evaluate-commands %sh{
@ -1607,6 +1609,11 @@ define-command -hidden fzf-tag -params 2..3 %{ evaluate-commands %sh{
exec=$(mktemp $(eval echo ${TMPDIR:-/tmp}/kak-exec.XXXXXX))
if [ ! -z "${kak_client_env_TMUX}" ]; then
case $items_command in
*Q*)
items_command=$(echo $items_command | sed 's:$kind \(\w\):\$kind \"\1\":')
;;
esac
cmd="$items_command | fzf-tmux -d $kak_opt_fzf_tmux_height --expect ctrl-q $additional_flags > $tmp"
elif [ ! -z "${kak_opt_termcmd}" ]; then
path=$(pwd)