mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
Only capture completions at the end of the buffer.
To prevent the suggestion from not starting with the buffer string. Example: `ls / /[cursor left][cursor left]b` Before the patch, suggests `ls /b /ls /bin/ /` After the patch, suggests `ls /b /bin/`. https://github.com/zsh-users/zsh-autosuggestions/issues/343#issuecomment-401675712
This commit is contained in:
parent
4869a757c8
commit
f1c3b98774
2 changed files with 6 additions and 0 deletions
|
@ -17,6 +17,9 @@ _zsh_autosuggest_capture_completion_widget() {
|
||||||
local -a +h comppostfuncs
|
local -a +h comppostfuncs
|
||||||
comppostfuncs=(_zsh_autosuggest_capture_postcompletion)
|
comppostfuncs=(_zsh_autosuggest_capture_postcompletion)
|
||||||
|
|
||||||
|
# Only capture completions at the end of the buffer
|
||||||
|
CURSOR=$#BUFFER
|
||||||
|
|
||||||
# Run the original widget wrapping `.complete-word` so we don't
|
# Run the original widget wrapping `.complete-word` so we don't
|
||||||
# recursively try to fetch suggestions, since our pty is forked
|
# recursively try to fetch suggestions, since our pty is forked
|
||||||
# after autosuggestions is initialized.
|
# after autosuggestions is initialized.
|
||||||
|
|
|
@ -487,6 +487,9 @@ _zsh_autosuggest_capture_completion_widget() {
|
||||||
local -a +h comppostfuncs
|
local -a +h comppostfuncs
|
||||||
comppostfuncs=(_zsh_autosuggest_capture_postcompletion)
|
comppostfuncs=(_zsh_autosuggest_capture_postcompletion)
|
||||||
|
|
||||||
|
# Only capture completions at the end of the buffer
|
||||||
|
CURSOR=$#BUFFER
|
||||||
|
|
||||||
# Run the original widget wrapping `.complete-word` so we don't
|
# Run the original widget wrapping `.complete-word` so we don't
|
||||||
# recursively try to fetch suggestions, since our pty is forked
|
# recursively try to fetch suggestions, since our pty is forked
|
||||||
# after autosuggestions is initialized.
|
# after autosuggestions is initialized.
|
||||||
|
|
Loading…
Reference in a new issue