Browse Source

'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 years ago
parent
commit
451665cb2a
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      highlighters/main/main-highlighter.zsh

+ 9
- 0
highlighters/main/main-highlighter.zsh View File

@ -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 ')'

Loading…
Cancel
Save