Default strategy now tries history first and falls back to completion
This commit is contained in:
@@ -631,11 +631,28 @@ _zsh_autosuggest_strategy_completion() {
|
||||
#--------------------------------------------------------------------#
|
||||
# Default Suggestion Strategy #
|
||||
#--------------------------------------------------------------------#
|
||||
# Will provide suggestions from your history. If no matches are found
|
||||
# in history, will provide a suggestion from the completion engine.
|
||||
#
|
||||
|
||||
_zsh_autosuggest_strategy_default() {
|
||||
typeset -g suggestion
|
||||
|
||||
_zsh_autosuggest_strategy_history "$1"
|
||||
|
||||
if [[ -z "$suggestion" ]]; then
|
||||
_zsh_autosuggest_strategy_completion "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------#
|
||||
# History Suggestion Strategy #
|
||||
#--------------------------------------------------------------------#
|
||||
# Suggests the most recent history item that matches the given
|
||||
# prefix.
|
||||
#
|
||||
|
||||
_zsh_autosuggest_strategy_default() {
|
||||
_zsh_autosuggest_strategy_history() {
|
||||
# Reset options to defaults and enable LOCAL_OPTIONS
|
||||
emulate -L zsh
|
||||
|
||||
|
||||
Reference in New Issue
Block a user