From a42d96b4465794ffd2fadf9d16927eb1eff106be Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 15 Oct 2018 13:24:17 +0300 Subject: [PATCH] move awk to main fzf function because of escape problems --- rc/fzf.kak | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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="