Compare commits

..
2 Commits
Author SHA1 Message Date
Eric Freese 2b449a62f8 bump version v0.2.10 2016-02-16 20:59:31 -07:00
Eric Freese 6d25df6864 Revert usage of fc for suggestions and fix for sh_word_split.
Force field splitting on \0 to support sh_word_split option.
2016-02-16 10:51:01 -07:00
3 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
v0.2.9
v0.2.10
+6 -1
View File
@@ -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]"
}
+7 -2
View File
@@ -1,6 +1,6 @@
# Fish-like fast/unobtrusive autosuggestions for zsh.
# https://github.com/tarruda/zsh-autosuggestions
# v0.2.9
# v0.2.10
# Copyright (c) 2013 Thiago de Arruda
# Copyright (c) 2016 Eric Freese
#
@@ -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]"
}
#--------------------------------------------------------------------#