mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
Rename and document new config var
This commit is contained in:
parent
7b81eb79b8
commit
2450c95d8a
3 changed files with 6 additions and 3 deletions
|
@ -47,3 +47,6 @@ ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS=(
|
||||||
vi-forward-blank-word
|
vi-forward-blank-word
|
||||||
vi-forward-blank-word-end
|
vi-forward-blank-word-end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Max size of buffer to trigger autosuggestion. Leave undefined for no upper bound.
|
||||||
|
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=
|
||||||
|
|
|
@ -25,7 +25,7 @@ _zsh_autosuggest_modify() {
|
||||||
# Get a new suggestion if the buffer is not empty after modification
|
# Get a new suggestion if the buffer is not empty after modification
|
||||||
local suggestion
|
local suggestion
|
||||||
if [ $#BUFFER -gt 0 ]; then
|
if [ $#BUFFER -gt 0 ]; then
|
||||||
if [ -z "$ZSH_BUFFER_MAX_SIZE" -o $#BUFFER -lt "$ZSH_BUFFER_MAX_SIZE" ]; then
|
if [ -z "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" -o $#BUFFER -lt "$ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE" ]; then
|
||||||
suggestion="$(_zsh_autosuggest_suggestion "$BUFFER")"
|
suggestion="$(_zsh_autosuggest_suggestion "$BUFFER")"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -9,7 +9,7 @@ oneTimeSetUp() {
|
||||||
setUp() {
|
setUp() {
|
||||||
BUFFER=''
|
BUFFER=''
|
||||||
POSTDISPLAY=''
|
POSTDISPLAY=''
|
||||||
ZSH_BUFFER_MAX_SIZE=''
|
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=''
|
||||||
}
|
}
|
||||||
|
|
||||||
tearDown() {
|
tearDown() {
|
||||||
|
@ -45,7 +45,7 @@ testModify() {
|
||||||
|
|
||||||
testModifyBufferTooLarge() {
|
testModifyBufferTooLarge() {
|
||||||
|
|
||||||
ZSH_BUFFER_MAX_SIZE='20'
|
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE='20'
|
||||||
|
|
||||||
stub_and_eval \
|
stub_and_eval \
|
||||||
_zsh_autosuggest_invoke_original_widget \
|
_zsh_autosuggest_invoke_original_widget \
|
||||||
|
|
Loading…
Reference in a new issue