mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
parent
dcc99a8649
commit
e0165eaa73
3 changed files with 105 additions and 4 deletions
|
|
@ -254,10 +254,9 @@ _zsh_highlight_main__is_runnable() {
|
|||
_zsh_highlight_main__is_redirection() {
|
||||
# A redirection operator token:
|
||||
# - starts with an optional single-digit number;
|
||||
# - then, has a '<' or '>' character;
|
||||
# - is not a process substitution [<(...) or >(...)].
|
||||
# - is not a numeric glob <->
|
||||
[[ $1 == (<0-9>|)(\<|\>)* ]] && [[ $1 != (\<|\>)$'\x28'* ]] && [[ $1 != *'<'*'-'*'>'* ]]
|
||||
# - is one of the tokens listed in zshmisc(1)
|
||||
# - however (z) normalizes ! to |
|
||||
[[ ${1#[0-9]} == (\<|\<\>|(\>|\>\>)(|\|)|\<\<(|-)|\<\<\<|\<\&|\&\<|(\>|\>\>)\&(|\|)|\&(\>|\>\>)(|\||\!)) ]]
|
||||
}
|
||||
|
||||
# Resolve alias.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue