Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix #670 #682

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions highlighters/main/main-highlighter.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -628,18 +628,27 @@ _zsh_highlight_main_highlighter_highlight_list()
(( ${+parameters[(e)${MATCH}]} )) && [[ ${parameters[(e)$MATCH]} != *special* ]]
then
# Set $arg.
local -a words
local testarg
case ${(tP)MATCH} in
(*array*|*assoc*)
local -a words; words=( ${(P)MATCH} )
arg=${words[1]}
words=( ${(P)MATCH} )
testarg=${words[1]}
;;
(*)
# scalar, presumably
arg=${(P)MATCH}
words=( ${(zP)MATCH} )
testarg=${words[1]}
;;
esac
_zsh_highlight_main__type "$arg" 0
res=$REPLY
_zsh_highlight_main__type "$testarg" 0
if [[ -n $REPLY ]] && [[ $REPLY != none ]]; then
res=$REPLY
arg=$testarg
elif _zsh_highlight_main_highlighter_check_path $testarg; then
res=none
arg=$testarg
fi
fi
}

Expand Down