From 1c4ad6b6dc9a8ff61297c403daace094bee4c6ac Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 18 Jan 2018 23:26:20 +0000 Subject: [PATCH] 'main': Don't match redirection operators in command substitutions as <-> number range globs. Fixes #483. --- highlighters/main/main-highlighter.zsh | 2 +- highlighters/main/test-data/redirection-in-cmdsubst.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 61cc17e..8214fcd 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -822,7 +822,7 @@ _zsh_highlight_main_highlighter_highlight_argument() elif [[ $arg[i+1] == [*@#?-$!] ]]; then (( i += 1 )) fi;; - [*?]*|\<*) + [*?]*|\<[0-9]#-[0-9]#\>) # The '<' is for the <-> globbing syntax. (This function doesn't get called on redirection tokens.) if $highlight_glob; then _zsh_highlight_main_add_region_highlight $start_pos $end_pos globbing diff --git a/highlighters/main/test-data/redirection-in-cmdsubst.zsh b/highlighters/main/test-data/redirection-in-cmdsubst.zsh index ea1155d..ac7a365 100644 --- a/highlighters/main/test-data/redirection-in-cmdsubst.zsh +++ b/highlighters/main/test-data/redirection-in-cmdsubst.zsh @@ -32,5 +32,5 @@ BUFFER=$': $(