mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
Quoting fixes for zsh 5.0
This commit is contained in:
parent
046b9051c3
commit
11fbcc2089
2 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue