Skip to content

Instantly share code, notes, and snippets.

@hchbaw
Created December 31, 2010 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hchbaw/760562 to your computer and use it in GitHub Desktop.
Save hchbaw/760562 to your computer and use it in GitHub Desktop.
From 950f3a97678690306c46855e4aac887b7a80c53b Mon Sep 17 00:00:00 2001
From: Takeshi Banse <takebi@laafc.net>
Date: Fri, 31 Dec 2010 09:45:30 +0900
Subject: [PATCH] Fix for some aliased commands
It seems that some aliases which contain some hyphens yeild an error.
% alias l='ls -sF --color=auto'
% l
_zsh_highlight-zle-buffer:local:16: not valid in this context: -sF
Signed-off-by: Takeshi Banse <takebi@laafc.net>
---
zsh-syntax-highlighting.zsh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh
index 49811ba..11c1ccc 100644
--- a/zsh-syntax-highlighting.zsh
+++ b/zsh-syntax-highlighting.zsh
@@ -111,7 +111,7 @@ _zsh_highlight-zle-buffer() {
case $res in
*': reserved') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[reserved-word];;
*': alias') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[alias]
- local aliased_command=${$(alias $arg)#*=}
+ local aliased_command=${"$(alias $arg)"#*=}
[[ ${${ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS[(r)$aliased_command]:-}:+yes} = 'yes' ]] && ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS+=($arg)
;;
*': builtin') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[builtin];;
--
1.7.3.2.451.g1c2ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment