소스 검색

'main': Don't highlight at the $PS3 prompt.

The input to the $PS3 prompt is not commands, so the 'main' highlighter is
not applicable to it.

Fixes zsh-users/zsh-syntax-highlighting#268.
pull/272/head
Daniel Shahaf 8 년 전
부모
커밋
451665cb2a
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. +9
    -0
      highlighters/main/main-highlighter.zsh

+ 9
- 0
highlighters/main/main-highlighter.zsh 파일 보기

@ -108,6 +108,15 @@ _zsh_highlight_main_highlighter()
emulate -L zsh
setopt localoptions extendedglob bareglobqual
# At the PS3 prompt, highlight nothing.
#
# (We can't check this in _zsh_highlight_main_highlighter_predicate because
# if the predicate returns false, the previous value of region_highlight
# would be reused.)
if [[ $CONTEXT == 'select' ]]; then
return
fi
## Variable declarations and initializations
local start_pos=0 end_pos highlight_glob=true arg style
local in_array_assignment=false # true between 'a=(' and the matching ')'

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