浏览代码

fix(theme-and-appearance): fix `diff` completion in macOS

Closes #11416
Closes #11454
Carlo Sala 2 年之前
父节点
当前提交
657ad0523d
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      lib/theme-and-appearance.zsh

+ 5 - 1
lib/theme-and-appearance.zsh

@@ -41,7 +41,11 @@ fi
 
 # enable diff color if possible.
 if command diff --color /dev/null /dev/null &>/dev/null; then
-  alias diff='diff --color'
+  function color-diff {
+    diff --color $@
+  }
+  alias diff="color-diff"
+  compdef _diff color-diff # compdef is already loaded by this point
 fi
 
 setopt auto_cd