diff --git a/rc/fzf.kak b/rc/fzf.kak index 5980120..285846c 100644 --- a/rc/fzf.kak +++ b/rc/fzf.kak @@ -74,7 +74,7 @@ Supported tools: universal-ctags: ""readtags"" Default arguments: - ""readtags -l | cut -f1 | awk '!a[\$0]++'"" + ""readtags -l | cut -f1"" " \ str fzf_tag_command "readtags" @@ -338,11 +338,13 @@ define-command -hidden fzf -params 2..3 %{ evaluate-commands %sh{ if [ ! -z "${kak_client_env_TMUX}" ]; then [ -z "${items_command##*Q*}" ] && items_command=$(echo $items_command | sed 's:$kind \(\w\):\$kind \"\1\":') + [ "$(echo $callback | awk '{print $1}')" = "ctags-search" ] && items_command="$items_command | awk '!a[\$0]++'" cmd="$preview_pos $items_command | fzf-tmux -d $tmux_height --expect ctrl-q $additional_flags > $tmp" elif [ ! -z "${kak_opt_termcmd}" ]; then path=$(pwd) additional_flags=$(echo $additional_flags | sed 's:\$pos:\\\\\\\$pos:') [ -z "${items_command##*Q*}" ] && items_command=$(echo $items_command | sed 's:$kind \(\w\):\\\\\\$kind \\\\\\\"\1\\\\\\\":') + [ "$(echo $callback | awk '{print $1}')" = "ctags-search" ] && items_command="$items_command | awk '!a[\\\\\\\$0]++'" cmd="$kak_opt_termcmd \"sh -c \\\"sh=$(command -v sh); SHELL=\\\$sh; export SHELL; cd $path && $preview_pos $items_command | fzf --expect ctrl-q $additional_flags > $tmp\\\"\"" else echo "fail termcmd option is not set" @@ -1612,9 +1614,9 @@ define-command -hidden fzf-tag -params ..1 %{ evaluate-commands %sh{ if [ ! -z "$1" ]; then mode=$(echo "$additional_message" | grep ":" | awk '{$1=""; print}' | sed "s/\(.*\)/:\1/") - cmd="readtags -Q '(eq? \$kind $1)' -l | cut -f1 | awk '!a[\$0]++'" + cmd="readtags -Q '(eq? \$kind $1)' -l | cut -f1" else - cmd="readtags -l | cut -f1 | awk '!a[\$0]++'" + cmd="readtags -l | cut -f1" fi [ ! -z "${kak_client_env_TMUX}" ] && tmux_keybindings="