make tmux-yank integration work with new set-buffer approach

This commit is contained in:
Jorge Morante 2017-04-19 22:52:55 +02:00
parent f42617ef03
commit 75a0ea9b54
1 changed files with 9 additions and 0 deletions

View File

@ -9,6 +9,9 @@ source $CURRENT_DIR/hints.sh
source $CURRENT_DIR/utils.sh
source $CURRENT_DIR/help.sh
FINGERS_COPY_COMMAND=$(tmux show-option -gqv @fingers-copy-command)
HAS_TMUX_YANK=$([ "$(tmux list-keys | grep -c tmux-yank)" == "0" ]; echo $?)
current_pane_id=$1
fingers_pane_id=$2
pane_input_temp=$3
@ -98,6 +101,12 @@ function copy_result() {
if [ ! -z "$FINGERS_COPY_COMMAND" ]; then
echo -n "$result" | eval "nohup $FINGERS_COPY_COMMAND" > /dev/null
fi
if [[ $HAS_TMUX_YANK = 1 ]]; then
tmux_yank_copy_command=$(tmux list-keys -t vi-copy | grep "vi-copy *y" | sed 's/.*copy-pipe "\(.*\)".*/\1/g')
echo -n "$result" | eval "nohup $tmux_yank_copy_command" > /dev/null
fi
}
while read -rsn1 char; do