File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ __fzf_generic_path_completion() {
4646 tail=$6
4747 fzf=" $( __fzfcmd_complete) "
4848
49- setopt localoptions nonomatch
49+ setopt nonomatch
5050 dir=" $base "
5151 while [ 1 ]; do
5252 if [[ -z " $dir " || -d ${~dir} ]]; then
@@ -142,8 +142,8 @@ _fzf_complete_unalias() {
142142}
143143
144144fzf-completion () {
145+ emulate -L zsh
145146 local tokens cmd prefix trigger tail fzf matches lbuf d_cmds
146- setopt localoptions noshwordsplit noksh_arrays
147147
148148 # http://zsh.sourceforge.net/FAQ/zshfaq03.html
149149 # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ __fzfcmd() {
2727}
2828
2929fzf-file-widget () {
30+ emulate -L zsh
3031 LBUFFER=" ${LBUFFER} $( __fsel) "
3132 local ret=$?
3233 zle redisplay
@@ -38,9 +39,10 @@ bindkey '^T' fzf-file-widget
3839
3940# ALT-C - cd into the selected directory
4041fzf-cd-widget () {
42+ emulate -L zsh
43+ setopt pipefail 2> /dev/null
4144 local cmd=" ${FZF_ALT_C_COMMAND:- " command find -L . -mindepth 1 \\ ( -path '*/\\ .*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\ ) -prune \
4245 -o -type d -print 2> /dev/null | cut -b3-" }"
43- setopt localoptions pipefail 2> /dev/null
4446 local dir=" $( eval " $cmd " | FZF_DEFAULT_OPTS=" --height ${FZF_TMUX_HEIGHT:- 40% } --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS " $( __fzfcmd) +m) "
4547 if [[ -z " $dir " ]]; then
4648 zle redisplay
@@ -57,8 +59,9 @@ bindkey '\ec' fzf-cd-widget
5759
5860# CTRL-R - Paste the selected command from history into the command line
5961fzf-history-widget () {
62+ emulate -L zsh
63+ setopt pipefail 2> /dev/null
6064 local selected num
61- setopt localoptions noglobsubst pipefail 2> /dev/null
6265 selected=( $( fc -l 1 |
6366 FZF_DEFAULT_OPTS=" --height ${FZF_TMUX_HEIGHT:- 40% } $FZF_DEFAULT_OPTS +s --tac -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(q)LBUFFER} +m" $( __fzfcmd) ) )
6467 local ret=$?
You can’t perform that action at this time.
0 commit comments