mirror of
				https://github.com/zsh-users/zsh-syntax-highlighting.git
				synced 2025-10-23 15:46:27 +08:00 
			
		
		
		
	driver: Use idiomatic module check
This commit is contained in:
		
							parent
							
								
									d0fb0df4ff
								
							
						
					
					
						commit
						f265ef0b9a
					
				| @ -51,12 +51,10 @@ fi | ||||
| 
 | ||||
| # This function takes a single argument F and returns True iff F is an autoload stub. | ||||
| _zsh_highlight__function_is_autoload_stub_p() { | ||||
|   if (( ${+functions} )); then | ||||
|     ## zsh/parameter is available | ||||
|   if zmodload -e zsh/parameter; then | ||||
|     #(( ${+functions[$1]} )) && | ||||
|     [[ "$functions[$1]" == *"builtin autoload -X" ]] | ||||
|   else | ||||
|     ## zsh/parameter isn't available | ||||
|     #[[ $(type -wa -- "$1") == *'function'* ]] && | ||||
|     [[ "${${(@f)"$(which -- "$1")"}[2]}" == $'\t'$histchars[3]' undefined' ]] | ||||
|   fi | ||||
| @ -65,11 +63,9 @@ _zsh_highlight__function_is_autoload_stub_p() { | ||||
| 
 | ||||
| # Return True iff the argument denotes a function name. | ||||
| _zsh_highlight__is_function_p() { | ||||
|   if (( ${+functions} )); then | ||||
|     ## zsh/parameter is available | ||||
|   if zmodload -e zsh/parameter; then | ||||
|     (( ${+functions[$1]} )) | ||||
|   else | ||||
|     ## zsh/parameter isn't available | ||||
|     [[ $(type -wa -- "$1") == *'function'* ]] | ||||
|   fi | ||||
| } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Matthew Martin
						Matthew Martin