瀏覽代碼

driver: Be immune to weird aliases in the calling scope.

Fixes #390.
pull/399/head
Daniel Shahaf 7 年之前
父節點
當前提交
2dce602727
共有 1 個檔案被更改,包括 11 行新增1 行删除
  1. +11
    -1
      zsh-syntax-highlighting.zsh

+ 11
- 1
zsh-syntax-highlighting.zsh 查看文件

@ -27,6 +27,9 @@
# vim: ft=zsh sw=2 ts=2 et
# -------------------------------------------------------------------------------------------------
# First of all, ensure predictable parsing.
zsh_highlight__aliases=`alias -L`
builtin unalias -m '*'
# Set $0 to the expected value, regardless of functionargzero.
0=${(%):-%N}
@ -390,4 +393,11 @@ zmodload zsh/parameter 2>/dev/null || true
autoload -U is-at-least
# Initialize the array of active highlighters if needed.
[[ $#ZSH_HIGHLIGHT_HIGHLIGHTERS -eq 0 ]] && ZSH_HIGHLIGHT_HIGHLIGHTERS=(main) || true
[[ $#ZSH_HIGHLIGHT_HIGHLIGHTERS -eq 0 ]] && ZSH_HIGHLIGHT_HIGHLIGHTERS=(main)
# Restore the aliases we unned
eval "$zsh_highlight__aliases"
builtin unset zsh_highlight__aliases
# Set $?.
true

Loading…
取消
儲存