From 57105be9b88f03cf591e4ba3d03380fe67c20dee Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Fri, 6 May 2016 09:38:13 -0500 Subject: [PATCH] Use the new _zsh_highlighter_add_highlight function --- url/url-highlighter.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/url/url-highlighter.zsh b/url/url-highlighter.zsh index 0eb5568..e9fb089 100644 --- a/url/url-highlighter.zsh +++ b/url/url-highlighter.zsh @@ -51,7 +51,7 @@ _zsh_highlight_url_highlighter() done local match_count=$#matches - local i + local i style for ((i=1; $i <= $match_count; i++)); do match=$matches[$i] @@ -67,10 +67,11 @@ _zsh_highlight_url_highlighter() _ZSH_HIGHLIGHT_URL_HIGHLIGHTER_CACHE[$match]=$status_code fi if [[ "$status_code" == "200" ]]; then - region_highlight+=("$matches_starts[$i] $matches_ends[$i] ${ZSH_HIGHLIGHT_STYLES[url-good]}") + style=url-good else - region_highlight+=("$matches_starts[$i] $matches_ends[$i] ${ZSH_HIGHLIGHT_STYLES[url-bad]}") + style=url-bad fi + _zsh_highlight_add_highlight $matches_starts[i] $matches_ends[i] $style done }