zsh-users/zsh-syntax-highlighting

$READNULLCMD / $NULLCMD are red

开放

#716 创建于 2020年3月23日

 (0 条评论) (0 个反应) (0 位负责人)Shell (1,371 个派生)batch import
BugTaskgood first issuesyntax:command-word

仓库指标

星标
 (22,617 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

% tests/generate.zsh '$NULLCMD | $READNULLCMD' main nullcmd 'local NULLCMD=cat READNULLCMD=f; f(){};' 
Set copyright year to 2020? y
local NULLCMD=cat READNULLCMD=f; f(){};

BUFFER=$'$NULLCMD | $READNULLCMD'

expected_region_highlight=(
  '1 8 unknown-token' # $NULLCMD
  '10 10 commandseparator' # |
  '12 23 unknown-token' # $READNULLCMD
)

That's likely because they're special, and as such don't get expanded (which makes this another case of #695):

% p ${(t)READNULLCMD} ${(t)NULLCMD}
scalar-special scalar-special

贡献者指南