Skip to content
Myr

[fish] Refactor __fzf_defaults

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Append all arguments after the first one, so that functions don't have to pass all appending options as a single string. Also, output everything as a single string (an array of one item).

authored by bitraid · committed by Junegunn Choi · parent 0ba0661 · Browse files · 1 file+7 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−6 removed

  • other:+7 added−6 removed

1 file+7 added−6 removed

modified:shell/key-bindings.fish+7 added-6 removed
15 unmodified lines
16# ------------17function fzf_key_bindings1819 function __fzf_defaults20 # $1: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS21 # $2: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS22 test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%23 echo "--height $FZF_TMUX_HEIGHT --min-height 20+ --bind=ctrl-z:ignore" $argv[1]24 test -r "$FZF_DEFAULT_OPTS_FILE"; and string collect -N -- <$FZF_DEFAULT_OPTS_FILE25 echo $FZF_DEFAULT_OPTS $argv[2]20 # $argv[1]: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS21 # $argv[2..]: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS22 test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40%23 string join ' ' -- \24 "--height $FZF_TMUX_HEIGHT --min-height=20+ --bind=ctrl-z:ignore" $argv[1] \25 (test -r "$FZF_DEFAULT_OPTS_FILE"; and string join -- ' ' <$FZF_DEFAULT_OPTS_FILE) \26 $FZF_DEFAULT_OPTS $argv[2..-1]27 end2829 # Store current token in $dir as root for the 'find' command30 function fzf-file-widget -d "List files and folders"
171 unmodified lines