mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-12-08 15:32:31 +01:00
Rename escape command function
This commit is contained in:
parent
73f774bd5d
commit
ee6dde9ee8
5 changed files with 15 additions and 15 deletions
|
|
@ -7,7 +7,7 @@
|
|||
#
|
||||
|
||||
_zsh_autosuggest_strategy_default() {
|
||||
local prefix="$(_zsh_autosuggest_escape_command_prefix "$1")"
|
||||
local prefix="$(_zsh_autosuggest_escape_command "$1")"
|
||||
|
||||
# Get the hist number of the most recent history item that matches
|
||||
local histkey="${${(@k)history[(R)$prefix*]}[1]}"
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#
|
||||
|
||||
_zsh_autosuggest_strategy_match_prev_cmd() {
|
||||
local prefix="$(_zsh_autosuggest_escape_command_prefix "$1")"
|
||||
local prefix="$(_zsh_autosuggest_escape_command "$1")"
|
||||
|
||||
# Get all history event numbers that correspond to history
|
||||
# entries that match pattern $prefix*
|
||||
|
|
@ -29,7 +29,7 @@ _zsh_autosuggest_strategy_match_prev_cmd() {
|
|||
|
||||
# Get the previously executed command
|
||||
local prev_cmd="$(_zsh_autosuggest_prev_command)"
|
||||
prev_cmd="$(_zsh_autosuggest_escape_command_prefix $prev_cmd)"
|
||||
prev_cmd="$(_zsh_autosuggest_escape_command $prev_cmd)"
|
||||
|
||||
# Iterate up to the first 200 history event numbers that match $prefix
|
||||
for key in "${(@)history_match_keys[1,200]}"; do
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ _zsh_autosuggest_suggestion() {
|
|||
fi
|
||||
}
|
||||
|
||||
_zsh_autosuggest_escape_command_prefix() {
|
||||
_zsh_autosuggest_escape_command() {
|
||||
setopt localoptions EXTENDED_GLOB
|
||||
|
||||
# Escape special chars in the string (requires EXTENDED_GLOB)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue