Use ${(Q)arg} to expand a level of quotes, such that files/directories with spaces in their name (escaped with backslash) are noticed correctly.
This commit is contained in:
		
							parent
							
								
									d2f641ca50
								
							
						
					
					
						commit
						a40d777860
					
				|  | @ -87,3 +87,4 @@ This must be done **after** the script is sourced, otherwise your styles will be | ||||||
|  * [Takeshi Banse](https://github.com/hchbaw) |  * [Takeshi Banse](https://github.com/hchbaw) | ||||||
|  * [Sorin Ionescu](https://github.com/SpookyET) |  * [Sorin Ionescu](https://github.com/SpookyET) | ||||||
|  * [Clayton Parker](https://github.com/claytron) |  * [Clayton Parker](https://github.com/claytron) | ||||||
|  |  * [Arlen Cuss](https://github.com/celtic) | ||||||
|  |  | ||||||
|  | @ -74,10 +74,10 @@ zle_highlight=( | ||||||
| 
 | 
 | ||||||
| # Check if the argument is a path. | # Check if the argument is a path. | ||||||
| _zsh_check-path() { | _zsh_check-path() { | ||||||
|   [[ -z $arg ]] && return 1 |   [[ -z ${(Q)arg} ]] && return 1 | ||||||
|   [[ -e $arg ]] && return 0 |   [[ -e ${(Q)arg} ]] && return 0 | ||||||
|   [[ ! -e ${arg:h} ]] && return 1 |   [[ ! -e ${(Q)arg:h} ]] && return 1 | ||||||
|   [[ ${#BUFFER} == $end_pos && -n $(print $arg*(N)) ]] && return 0 |   [[ ${#BUFFER} == $end_pos && -n $(print ${(Q)arg}*(N)) ]] && return 0 | ||||||
|   return 1 |   return 1 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue