From 29fd6ec1de4ddb159915d505bb68ac491ba8e1e9 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 17 Nov 2015 20:19:19 +0000 Subject: [PATCH] Support the '|&', '&!', '&|' command separators. --- highlighters/main/main-highlighter.zsh | 4 ++++ highlighters/main/test-data/commandseparator.zsh | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 21d2ae1..c341599 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -125,6 +125,10 @@ _zsh_highlight_main_highlighter() ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR=( '|' '||' ';' '&' '&&' + '|&' + '&!' '&|' + # ### 'case' syntax, but followed by a pattern, not by a command + # ';;' ';&' ';|' ) ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS=( 'builtin' 'command' 'exec' 'nocorrect' 'noglob' diff --git a/highlighters/main/test-data/commandseparator.zsh b/highlighters/main/test-data/commandseparator.zsh index 383bd47..7c152ff 100644 --- a/highlighters/main/test-data/commandseparator.zsh +++ b/highlighters/main/test-data/commandseparator.zsh @@ -29,9 +29,11 @@ ZSH_HIGHLIGHT_STYLES[commandseparator]=$unused_highlight -BUFFER=':; pwd' +BUFFER=':; pwd &! ls' expected_region_highlight=( "2 2 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; "4 6 $ZSH_HIGHLIGHT_STYLES[builtin]" # pwd + "8 9 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # &! + "11 12 $ZSH_HIGHLIGHT_STYLES[command]" # ls )