Skip to content

Commit

Permalink
User's definition of highlighting from "zle_highlight" array should t…
Browse files Browse the repository at this point in the history
…ake precedence over custom highlighters. This is especially important for *region context* (see CHARACTER HIGHLIGHTING chapter in `man zshzle` for *region context* definition), as this is overwritten by region_highlight array, leading to highlighting only parts of selected region properly.

This commit forces to use type of highlighting as defined in region context of zle_highlight array.
  • Loading branch information
jimmijj committed Sep 3, 2015
1 parent 1626558 commit ece762e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions zsh-syntax-highlighting.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ _zsh_highlight()
# Use value form cache if any cached
eval "region_highlight+=(\"\${${cache_place}[@]}\")"

# Bring back region higlighting from zle_highlight array (was overwriten by region_highlight)
((REGION_ACTIVE)) && region_highlight+=("$((CURSOR < MARK ? CURSOR : MARK)) $((CURSOR > MARK ? CURSOR : MARK)) ${${(M)zle_highlight[@]:#region*}#region:}")
done

} always {
Expand Down

0 comments on commit ece762e

Please sign in to comment.