Add possibility to replace the entire buffer from suggestion strategies

This commit is contained in:
Daan van der Kallen 2025-01-03 17:03:41 -05:00
commit f0a08e1647
4 changed files with 44 additions and 14 deletions

View file

@ -19,7 +19,10 @@ _zsh_autosuggest_fetch_suggestion() {
_zsh_autosuggest_strategy_$strategy "$1"
# Ensure the suggestion matches the prefix
[[ "$suggestion" != "$1"* ]] && unset suggestion
if [[ "$suggestion" != "$1"* ]]; then
unset suggestion
unset new_buffer
fi
# Break once we've found a valid suggestion
[[ -n "$suggestion" ]] && break