mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-12-08 15:32:31 +01:00
Disable autosuggest if buffer is too large
Make buffer max size configurable, defaulted to infinity
This commit is contained in:
parent
63816c5da8
commit
7b81eb79b8
3 changed files with 36 additions and 2 deletions
|
|
@ -25,7 +25,9 @@ _zsh_autosuggest_modify() {
|
|||
# Get a new suggestion if the buffer is not empty after modification
|
||||
local suggestion
|
||||
if [ $#BUFFER -gt 0 ]; then
|
||||
suggestion="$(_zsh_autosuggest_suggestion "$BUFFER")"
|
||||
if [ -z "$ZSH_BUFFER_MAX_SIZE" -o $#BUFFER -lt "$ZSH_BUFFER_MAX_SIZE" ]; then
|
||||
suggestion="$(_zsh_autosuggest_suggestion "$BUFFER")"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add the suggestion to the POSTDISPLAY
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue