소스 검색

'main': Fix issue #302, "Process substitution misparsed as redirection".

pull/308/head
Daniel Shahaf 8 년 전
부모
커밋
fc9c892a3f
2개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. +5
    -1
      highlighters/main/main-highlighter.zsh
  2. +1
    -1
      highlighters/main/test-data/redirection2.zsh

+ 5
- 1
highlighters/main/main-highlighter.zsh 파일 보기

@ -96,7 +96,11 @@ _zsh_highlight_main__type() {
# Check whether the first argument is a redirection operator token.
# Report result via the exit code.
_zsh_highlight_main__is_redirection() {
[[ $1 == (<0-9>|)(\<|\>)* ]]
# A redirection operator token:
# - starts with an optional single-digit number;
# - then, has a '<' or '>' character;
# - is not a process substitution [<(...) or >(...)].
[[ $1 == (<0-9>|)(\<|\>)* ]] && [[ $1 != (\<|\>)$'\x28'* ]]
}
# Main syntax highlighting function.

+ 1
- 1
highlighters/main/test-data/redirection2.zsh 파일 보기

@ -32,5 +32,5 @@ BUFFER='ls >(wc) | nl'
expected_region_highlight=(
"1 2 command" # ls
"10 10 commandseparator" # |
"12 13 command 'issue #302'" # nl
"12 13 command" # nl
)

불러오는 중...
취소
저장