From c604547c09cfe5a0ceec9f3b0698f2d11d054ac6 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Mon, 8 Apr 2019 11:28:11 +0300 Subject: [PATCH] simplify fzf-yank-ring --- rc/modules/fzf-yank-ring.kak | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/rc/modules/fzf-yank-ring.kak b/rc/modules/fzf-yank-ring.kak index 646615b..72045dc 100644 --- a/rc/modules/fzf-yank-ring.kak +++ b/rc/modules/fzf-yank-ring.kak @@ -20,8 +20,6 @@ hook global -once WinCreate .* %{ } } -declare-option -hidden str fzf_yank_ring_result - define-command -hidden fzf-yank-ring %{ evaluate-commands %sh{ yanks=$(mktemp ${TMPDIR:-/tmp}/kak-fzf-yanks.XXXXXX) eval "set -- $kak_opt_yank_ring_history" @@ -32,12 +30,10 @@ define-command -hidden fzf-yank-ring %{ evaluate-commands %sh{ done message="Swap between items in yank-ring." - printf "%s\n" "fzf -kak-cmd %{set-option global fzf_yank_ring_result} -items-cmd %{cat $yanks} -post-action %{fzf-yank-ring-set-dquote}" + printf "%s\n" "fzf -kak-cmd %{fzf-yank-ring-set-dquote} -items-cmd %{cat $yanks}" }} -define-command fzf-yank-ring-set-dquote %{ - set-register dquote %sh{ - printf "%s\n" "$kak_opt_fzf_yank_ring_result" | sed "s/␤/\n/g;" - } +define-command -hidden fzf-yank-ring-set-dquote -params 1 %{ + set-register dquote %sh{ printf "%s\n" "$1" | sed "s/␤/\n/g;" } }