Quoting fixes for zsh 5.0

This commit is contained in:
Geza Lore 2016-02-29 10:22:18 +00:00
parent 046b9051c3
commit 11fbcc2089
2 changed files with 6 additions and 4 deletions

View file

@ -14,7 +14,8 @@ _zsh_autosuggest_suggestion() {
# Get all history event numbers (reversed) that correspond to history # Get all history event numbers (reversed) that correspond to history
# entries that match pattern $prefix* # entries that match pattern $prefix*
local history_match_keys=(${(k)history[(R)$prefix*]}) local history_match_keys
history_match_keys=(${(k)history[(R)$prefix*]})
# By default we use the first history number (most recent history entry) # By default we use the first history number (most recent history entry)
local history_key="$history_match_keys[1]" local history_key="$history_match_keys[1]"
@ -22,7 +23,7 @@ _zsh_autosuggest_suggestion() {
# If matching on the previous command is enabled ... # If matching on the previous command is enabled ...
if (( ${+ZSH_AUTOSUGGEST_MATCH_PREV_CMD} )); then if (( ${+ZSH_AUTOSUGGEST_MATCH_PREV_CMD} )); then
# Get the previously executed command # Get the previously executed command
local prev_cmd=$(_zsh_autosuggest_prev_cmd) local prev_cmd="$(_zsh_autosuggest_prev_cmd)"
prev_cmd="$(_zsh_autosuggest_escape_command_prefix $prev_cmd)" prev_cmd="$(_zsh_autosuggest_escape_command_prefix $prev_cmd)"
# Iterate up to the first 200 history event numbers that match $prefix # Iterate up to the first 200 history event numbers that match $prefix

View file

@ -312,7 +312,8 @@ _zsh_autosuggest_suggestion() {
# Get all history event numbers (reversed) that correspond to history # Get all history event numbers (reversed) that correspond to history
# entries that match pattern $prefix* # entries that match pattern $prefix*
local history_match_keys=(${(k)history[(R)$prefix*]}) local history_match_keys
history_match_keys=(${(k)history[(R)$prefix*]})
# By default we use the first history number (most recent history entry) # By default we use the first history number (most recent history entry)
local history_key="$history_match_keys[1]" local history_key="$history_match_keys[1]"
@ -320,7 +321,7 @@ _zsh_autosuggest_suggestion() {
# If matching on the previous command is enabled ... # If matching on the previous command is enabled ...
if (( ${+ZSH_AUTOSUGGEST_MATCH_PREV_CMD} )); then if (( ${+ZSH_AUTOSUGGEST_MATCH_PREV_CMD} )); then
# Get the previously executed command # Get the previously executed command
local prev_cmd=$(_zsh_autosuggest_prev_cmd) local prev_cmd="$(_zsh_autosuggest_prev_cmd)"
prev_cmd="$(_zsh_autosuggest_escape_command_prefix $prev_cmd)" prev_cmd="$(_zsh_autosuggest_escape_command_prefix $prev_cmd)"
# Iterate up to the first 200 history event numbers that match $prefix # Iterate up to the first 200 history event numbers that match $prefix