From f265ef0b9aadfea02c696821664c8598f5809b91 Mon Sep 17 00:00:00 2001
From: Matthew Martin <phy1729@gmail.com>
Date: Mon, 8 Jan 2018 12:35:45 -0600
Subject: [PATCH] driver: Use idiomatic module check

---
 zsh-syntax-highlighting.zsh | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh
index 6fb1c12..c03c434 100644
--- a/zsh-syntax-highlighting.zsh
+++ b/zsh-syntax-highlighting.zsh
@@ -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
 }