From 11fbcc2089bb5e78ec481419fb69ab13323f0999 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Mon, 29 Feb 2016 10:22:18 +0000 Subject: [PATCH] Quoting fixes for zsh 5.0 --- src/suggestion.zsh | 5 +++-- zsh-autosuggestions.zsh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/suggestion.zsh b/src/suggestion.zsh index 7ef2def..786d8b8 100644 --- a/src/suggestion.zsh +++ b/src/suggestion.zsh @@ -14,7 +14,8 @@ _zsh_autosuggest_suggestion() { # Get all history event numbers (reversed) that correspond to history # 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) local history_key="$history_match_keys[1]" @@ -22,7 +23,7 @@ _zsh_autosuggest_suggestion() { # If matching on the previous command is enabled ... if (( ${+ZSH_AUTOSUGGEST_MATCH_PREV_CMD} )); then # 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)" # Iterate up to the first 200 history event numbers that match $prefix diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 45d60d1..9194ab5 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -312,7 +312,8 @@ _zsh_autosuggest_suggestion() { # Get all history event numbers (reversed) that correspond to history # 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) local history_key="$history_match_keys[1]" @@ -320,7 +321,7 @@ _zsh_autosuggest_suggestion() { # If matching on the previous command is enabled ... if (( ${+ZSH_AUTOSUGGEST_MATCH_PREV_CMD} )); then # 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)" # Iterate up to the first 200 history event numbers that match $prefix