diff --git a/README.md b/README.md index 2888ae2..365fe2a 100644 --- a/README.md +++ b/README.md @@ -446,7 +446,7 @@ As you see, z.lua is the fastest one and requires less resource. ## History -- 1.4.7 (2019-02-13): Be aware of all arguments in fzf completion, don't use regex in backward jumping (use plain text). +- 1.4.7 (2019-02-13): Don't use regex in backward jumping (use plain text instead). - 1.4.6 (2019-02-12): change: `_ZL_EXCLUDE_DIRS` to a comma separated list of dirs to exclude. - 1.4.5 (2019-02-10): improve bash fzf completion and posix compatibility. - 1.4.4 (2019-02-10): supports legacy posix shells like ksh, init with `z.lua --init posix legacy`. diff --git a/z.lua b/z.lua index eeca2a5..9b4a013 100755 --- a/z.lua +++ b/z.lua @@ -1881,8 +1881,8 @@ if [ "$TERM" != "dumb" ] && command -v fzf >/dev/null 2>&1; then # To redraw line after fzf closes (printf '\e[5n') bind '"\e[0n": redraw-current-line' _zlua_fzf_complete() { - local args=("${COMP_WORDS[@]:1}") - local selected=$(_zlua -l "${args[@]}" | sed "s|$HOME|\~|" | $zlua_fzf | sed 's/^[0-9,.]* *//') + local query="${COMP_WORDS[COMP_CWORD]}" + local selected=$(_zlua | sed "s|$HOME|\~|" | $zlua_fzf --query "$query" | sed 's/^[0-9,.]* *//') if [ -n "$selected" ]; then COMPREPLY=( "$selected" ) fi