Ver código fonte

Merge pull request #473 from zsh-users/refactor-null-byte-split

cleanup: Split on null bytes instead of pattern matching
pull/494/head
Eric Freese 4 anos atrás
committed by GitHub
pai
commit
8f3f59542a
Nenhuma chave conhecida encontrada para esta assinatura no banco de dados ID da chave GPG: 4AEE18F83AFDEB23
2 arquivos alterados com 2 adições e 2 exclusões
  1. +1
    -1
      src/strategies/completion.zsh
  2. +1
    -1
      zsh-autosuggestions.zsh

+ 1
- 1
src/strategies/completion.zsh Ver arquivo

@ -122,7 +122,7 @@ _zsh_autosuggest_strategy_completion() {
# versions of zsh (older than 5.3), we sometimes get extra bytes after # versions of zsh (older than 5.3), we sometimes get extra bytes after
# the second null byte, so trim those off the end. # the second null byte, so trim those off the end.
# See http://www.zsh.org/mla/workers/2015/msg03290.html # See http://www.zsh.org/mla/workers/2015/msg03290.html
suggestion="${${line#*$'\0'}%$'\0'*}"
suggestion="${${(@0)line}[2]}"
} always { } always {
# Destroy the pty # Destroy the pty
zpty -d $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME zpty -d $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME

+ 1
- 1
zsh-autosuggestions.zsh Ver arquivo

@ -608,7 +608,7 @@ _zsh_autosuggest_strategy_completion() {
# versions of zsh (older than 5.3), we sometimes get extra bytes after # versions of zsh (older than 5.3), we sometimes get extra bytes after
# the second null byte, so trim those off the end. # the second null byte, so trim those off the end.
# See http://www.zsh.org/mla/workers/2015/msg03290.html # See http://www.zsh.org/mla/workers/2015/msg03290.html
suggestion="${${line#*$'\0'}%$'\0'*}"
suggestion="${${(@0)line}[2]}"
} always { } always {
# Destroy the pty # Destroy the pty
zpty -d $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME zpty -d $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME

Carregando…
Cancelar
Salvar