1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-03-15 12:19:49 +00:00

roll back to old fzf completion

This commit is contained in:
skywind3000
2019-02-13 20:31:40 +08:00
parent 5c3e9834a5
commit 582299dc2c
2 changed files with 3 additions and 3 deletions

View File

@@ -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`.

4
z.lua
View File

@@ -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