Skip to content

Commit f265ef0

Browse files
committed
driver: Use idiomatic module check
1 parent d0fb0df commit f265ef0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

zsh-syntax-highlighting.zsh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ fi
5151

5252
# This function takes a single argument F and returns True iff F is an autoload stub.
5353
_zsh_highlight__function_is_autoload_stub_p() {
54-
if (( ${+functions} )); then
55-
## zsh/parameter is available
54+
if zmodload -e zsh/parameter; then
5655
#(( ${+functions[$1]} )) &&
5756
[[ "$functions[$1]" == *"builtin autoload -X" ]]
5857
else
59-
## zsh/parameter isn't available
6058
#[[ $(type -wa -- "$1") == *'function'* ]] &&
6159
[[ "${${(@f)"$(which -- "$1")"}[2]}" == $'\t'$histchars[3]' undefined' ]]
6260
fi
@@ -65,11 +63,9 @@ _zsh_highlight__function_is_autoload_stub_p() {
6563

6664
# Return True iff the argument denotes a function name.
6765
_zsh_highlight__is_function_p() {
68-
if (( ${+functions} )); then
69-
## zsh/parameter is available
66+
if zmodload -e zsh/parameter; then
7067
(( ${+functions[$1]} ))
7168
else
72-
## zsh/parameter isn't available
7369
[[ $(type -wa -- "$1") == *'function'* ]]
7470
fi
7571
}

0 commit comments

Comments
 (0)