Skip to content
Open
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
7 changes: 4 additions & 3 deletions url/url-highlighter.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
}

Expand Down