add fingers-copy-command-uppercase option

This commit is contained in:
Jorge Morante 2018-02-14 22:54:02 +01:00
parent e216bbc000
commit c4a8c4eb03
2 changed files with 7 additions and 2 deletions

View File

@ -82,6 +82,7 @@ fingers_defaults=( \
[fingers-patterns]="$PATTERNS" \
[fingers-compact-hints]=1 \
[fingers-copy-command]="" \
[fingers-copy-command-uppercase]="" \
[fingers-hint-position]="left" \
[fingers-hint-format]="#[fg=yellow,bold]%s" \
@ -95,6 +96,7 @@ fingers_defaults=( \
set_tmux_env 'fingers-patterns'
set_tmux_env 'fingers-compact-hints'
set_tmux_env 'fingers-copy-command'
set_tmux_env 'fingers-copy-command-uppercase'
set_tmux_env 'fingers-hint-position'
set_tmux_env 'fingers-hint-format' process_format

View File

@ -111,8 +111,11 @@ function copy_result() {
exec_prefix=""
fi
if [ ! -z "$FINGERS_COPY_COMMAND" ]; then
is_uppercase=$(echo "$input" | grep -E '^[a-z]+$' &> /dev/null; echo $?)
is_uppercase=$(echo "$input" | grep -E '^[a-z]+$' &> /dev/null; echo $?)
if [[ $is_uppercase == "1" ]] && [ ! -z "$FINGERS_COPY_COMMAND_UPPERCASE" ]; then
tmux run-shell -b "echo -n \"$result\" | IS_UPPERCASE=$is_uppercase HINT=$hint $exec_prefix $FINGERS_COPY_COMMAND_UPPERCASE > /dev/null"
elif [ ! -z "$FINGERS_COPY_COMMAND" ]; then
tmux run-shell -b "echo -n \"$result\" | IS_UPPERCASE=$is_uppercase HINT=$hint $exec_prefix $FINGERS_COPY_COMMAND > /dev/null"
fi