Bläddra i källkod

Add to explanation of extra stuff after `zpty -r`

pull/420/head
Eric Freese 5 år sedan
förälder
incheckning
c04e015d13
2 ändrade filer med 8 tillägg och 4 borttagningar
  1. +4
    -2
      src/strategies/completion.zsh
  2. +4
    -2
      zsh-autosuggestions.zsh

+ 4
- 2
src/strategies/completion.zsh Visa fil

@ -108,8 +108,10 @@ _zsh_autosuggest_strategy_completion() {
# content between the first two null bytes.
zpty -r $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME line '*'$'\0''*'$'\0'
# On older versions of zsh, we sometimes get extra bytes after the
# second null byte, so trim those off the end
# Extract the suggestion from between the null bytes. On older
# versions of zsh (older than 5.3), we sometimes get extra bytes after
# the second null byte, so trim those off the end.
# See http://www.zsh.org/mla/workers/2015/msg03290.html
suggestion="${${${(M)line:#*$'\0'*$'\0'*}#*$'\0'}%%$'\0'*}"
} always {
# Destroy the pty

+ 4
- 2
zsh-autosuggestions.zsh Visa fil

@ -590,8 +590,10 @@ _zsh_autosuggest_strategy_completion() {
# content between the first two null bytes.
zpty -r $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME line '*'$'\0''*'$'\0'
# On older versions of zsh, we sometimes get extra bytes after the
# second null byte, so trim those off the end
# Extract the suggestion from between the null bytes. On older
# versions of zsh (older than 5.3), we sometimes get extra bytes after
# the second null byte, so trim those off the end.
# See http://www.zsh.org/mla/workers/2015/msg03290.html
suggestion="${${${(M)line:#*$'\0'*$'\0'*}#*$'\0'}%%$'\0'*}"
} always {
# Destroy the pty

Laddar…
Avbryt
Spara