parent
							
								
									3ac7d1c785
								
							
						
					
					
						commit
						08d4401fae
					
				|  | @ -33,6 +33,7 @@ This highlighter defines the following styles: | |||
| * `globbing` - globbing expressions (`*.txt`) | ||||
| * `history-expansion` - history expansion expressions (`!foo` and `^foo^bar`) | ||||
| * `command-substitution` - command substitutions (`$(echo foo)`) | ||||
| * `process-substitution` - process substitutions (`<(echo foo)`) | ||||
| * `single-hyphen-option` - single-hyphen options (`-o`) | ||||
| * `double-hyphen-option` - double-hyphen options (`--option`) | ||||
| * `back-quoted-argument` - backtick command substitution (`` `foo` ``) | ||||
|  |  | |||
|  | @ -41,6 +41,7 @@ | |||
| : ${ZSH_HIGHLIGHT_STYLES[globbing]:=fg=blue} | ||||
| : ${ZSH_HIGHLIGHT_STYLES[history-expansion]:=fg=blue} | ||||
| : ${ZSH_HIGHLIGHT_STYLES[command-substitution]:=fg=magenta} | ||||
| : ${ZSH_HIGHLIGHT_STYLES[process-substitution]:=fg=magenta} | ||||
| : ${ZSH_HIGHLIGHT_STYLES[single-hyphen-option]:=none} | ||||
| : ${ZSH_HIGHLIGHT_STYLES[double-hyphen-option]:=none} | ||||
| : ${ZSH_HIGHLIGHT_STYLES[back-quoted-argument]:=none} | ||||
|  | @ -896,6 +897,16 @@ _zsh_highlight_main_highlighter_highlight_argument() | |||
|         if [[ $arg[i+1] == [*@#?$!-] ]]; then | ||||
|           (( i += 1 )) | ||||
|         fi;; | ||||
|       [\<\>]) | ||||
|         if [[ $arg[i+1] == $'\x28' ]]; then # \x28 = open paren | ||||
|           start=$i | ||||
|           (( i += 2 )) | ||||
|           _zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,end_pos] | ||||
|           (( i += REPLY )) | ||||
|           highlights+=($(( start_pos + start - 1)) $(( start_pos + i )) process-substitution $reply) | ||||
|           continue | ||||
|         fi | ||||
|         ;| | ||||
|       *) | ||||
|         if $highlight_glob && [[ ${arg[$i]} =~ ^[*?] || ${arg:$i-1} =~ ^\<[0-9]*-[0-9]*\> ]]; then | ||||
|           highlights+=($(( start_pos + i - 1 )) $(( start_pos + i + $#MATCH - 1)) globbing) | ||||
|  |  | |||
|  | @ -31,7 +31,9 @@ BUFFER='ls >(wc) | nl' | |||
| 
 | ||||
| expected_region_highlight=( | ||||
|   "1 2 command" # ls | ||||
|   "4 8 process-substitution 'issue #494'" # >(wc) | ||||
|   "4 8 default" # >(wc) | ||||
|   "4 8 process-substitution" # >(wc) | ||||
|   "6 7 command" # wc | ||||
|   "10 10 commandseparator" # | | ||||
|   "12 13 command" # nl | ||||
| ) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue