mirror of
				https://github.com/zsh-users/zsh-syntax-highlighting.git
				synced 2025-10-23 15:46:27 +08:00 
			
		
		
		
	Remove path_approx.
Fixes zsh-users/zsh-syntax-highlighting#187. Adds a test for zsh-users/zsh-syntax-highlighting#204.
This commit is contained in:
		
							parent
							
								
									4d3da30f8b
								
							
						
					
					
						commit
						98aee7f8b9
					
				| @ -34,7 +34,6 @@ This highlighter defines the following styles: | |||||||
| * `hashed-command` - hashed commands | * `hashed-command` - hashed commands | ||||||
| * `path` - paths | * `path` - paths | ||||||
| * `path_prefix` - path prefixes | * `path_prefix` - path prefixes | ||||||
| * `path_approx` - approximated paths |  | ||||||
| * `globbing` - globbing expressions (`*.txt`) | * `globbing` - globbing expressions (`*.txt`) | ||||||
| * `history-expansion` - history expansion expressions (`!foo` and `^foo^bar`) | * `history-expansion` - history expansion expressions (`!foo` and `^foo^bar`) | ||||||
| * `single-hyphen-option` - single hyphen options (-o) | * `single-hyphen-option` - single hyphen options (-o) | ||||||
|  | |||||||
| @ -42,7 +42,6 @@ | |||||||
| : ${ZSH_HIGHLIGHT_STYLES[hashed-command]:=fg=green} | : ${ZSH_HIGHLIGHT_STYLES[hashed-command]:=fg=green} | ||||||
| : ${ZSH_HIGHLIGHT_STYLES[path]:=underline} | : ${ZSH_HIGHLIGHT_STYLES[path]:=underline} | ||||||
| : ${ZSH_HIGHLIGHT_STYLES[path_prefix]:=underline} | : ${ZSH_HIGHLIGHT_STYLES[path_prefix]:=underline} | ||||||
| : ${ZSH_HIGHLIGHT_STYLES[path_approx]:=fg=yellow,underline} |  | ||||||
| : ${ZSH_HIGHLIGHT_STYLES[globbing]:=fg=blue} | : ${ZSH_HIGHLIGHT_STYLES[globbing]:=fg=blue} | ||||||
| : ${ZSH_HIGHLIGHT_STYLES[history-expansion]:=fg=blue} | : ${ZSH_HIGHLIGHT_STYLES[history-expansion]:=fg=blue} | ||||||
| : ${ZSH_HIGHLIGHT_STYLES[single-hyphen-option]:=none} | : ${ZSH_HIGHLIGHT_STYLES[single-hyphen-option]:=none} | ||||||
| @ -285,9 +284,6 @@ _zsh_highlight_main_highlighter_check_path() | |||||||
|     local -a tmp |     local -a tmp | ||||||
|     tmp=( ${expanded_path}*(N) ) |     tmp=( ${expanded_path}*(N) ) | ||||||
|     (( $#tmp > 0 )) && style_override=path_prefix && return 0 |     (( $#tmp > 0 )) && style_override=path_prefix && return 0 | ||||||
|     # or maybe an approximate path? |  | ||||||
|     tmp=( (#a1)${expanded_path}*(N) ) |  | ||||||
|     (( $#tmp > 0 )) && style_override=path_approx && return 0 |  | ||||||
|   fi |   fi | ||||||
| 
 | 
 | ||||||
|   # It's not a path. |   # It's not a path. | ||||||
|  | |||||||
| @ -27,8 +27,7 @@ | |||||||
| # vim: ft=zsh sw=2 ts=2 et | # vim: ft=zsh sw=2 ts=2 et | ||||||
| # ------------------------------------------------------------------------------------------------- | # ------------------------------------------------------------------------------------------------- | ||||||
| 
 | 
 | ||||||
| # without the trailing space, it's highlighted as path_approx (issue #187, issue #204) | BUFFER='echo; ;' | ||||||
| BUFFER='echo; ; ' |  | ||||||
| 
 | 
 | ||||||
| expected_region_highlight=( | expected_region_highlight=( | ||||||
|   "5 5 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; |   "5 5 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Daniel Shahaf
						Daniel Shahaf