Check whether yank's copy command is set before invoking it

This commit is contained in:
Tomasz 2018-08-29 13:36:02 +02:00
parent 291fca6014
commit 3264cc0062
1 changed files with 3 additions and 1 deletions

View File

@ -114,6 +114,8 @@ function copy_result() {
local result="$1"
local hint="$2"
result="$(echo $result)"
[[ -z $result ]] && retun
tmux set-buffer "$result"
if [[ "$OSTYPE" == "linux-gnu" ]]; then
@ -130,7 +132,7 @@ function copy_result() {
tmux run-shell -b "printf \"$result\" | IS_UPPERCASE=$is_uppercase HINT=$hint $exec_prefix $FINGERS_COPY_COMMAND > /dev/null"
fi
if [[ $HAS_TMUX_YANK = 1 ]]; then
if [[ $HAS_TMUX_YANK = 1 ]] && [ ! -z "$tmux_yank_copy_command" ]; then
tmux run-shell -b "printf \"$result\" | $exec_prefix $tmux_yank_copy_command > /dev/null"
fi
}