2 #--------------------------------------------------------------------#
4 #--------------------------------------------------------------------#
6 # Delegate to the selected strategy to determine a suggestion
7 _zsh_autosuggest_suggestion
() {
8 local escaped_prefix
="$(_zsh_autosuggest_escape_command "$1")"
9 local strategy_function
="_zsh_autosuggest_strategy_$ZSH_AUTOSUGGEST_STRATEGY"
11 if [ -n "$functions[$strategy_function]" ]; then
12 echo -E "$($strategy_function "$escaped_prefix")"
16 _zsh_autosuggest_escape_command
() {
17 setopt localoptions EXTENDED_GLOB
19 # Escape special chars in the string (requires EXTENDED_GLOB)
20 echo -E "${1//(#m)[\\()\[\]|*?~]/\\$MATCH}"