Revert usage of `fc` for suggestions and fix for sh_word_split.

Force field splitting on \0 to support sh_word_split option.
pull/122/head
Eric Freese 9 years ago
parent 0faa2b6584
commit 6d25df6864

@ -10,5 +10,10 @@ _zsh_autosuggest_suggestion() {
# Escape the prefix (requires EXTENDED_GLOB)
local prefix="${1//(#m)[\][()|\\*?#<>~^]/\\$MATCH}"
fc -ln -m "$prefix*" 2>/dev/null | tail -1
# Get all history items (reversed) that match pattern $prefix*
local history_matches
history_matches=(${(j:\0:s:\0:)history[(R)$prefix*]})
# Echo the first item that matches
echo "$history_matches[1]"
}

@ -293,7 +293,12 @@ _zsh_autosuggest_suggestion() {
# Escape the prefix (requires EXTENDED_GLOB)
local prefix="${1//(#m)[\][()|\\*?#<>~^]/\\$MATCH}"
fc -ln -m "$prefix*" 2>/dev/null | tail -1
# Get all history items (reversed) that match pattern $prefix*
local history_matches
history_matches=(${(j:\0:s:\0:)history[(R)$prefix*]})
# Echo the first item that matches
echo "$history_matches[1]"
}
#--------------------------------------------------------------------#

Loading…
Cancel
Save