-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Currently z-sy-h reimplements $zle_highlight
's semantics:
zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
Lines 163 to 193 in 91d2eea
# Re-apply zle_highlight settings | |
# region | |
() { | |
(( REGION_ACTIVE )) || return | |
integer min max | |
if (( MARK > CURSOR )) ; then | |
min=$CURSOR max=$MARK | |
else | |
min=$MARK max=$CURSOR | |
fi | |
if (( REGION_ACTIVE == 1 )); then | |
[[ $KEYMAP = vicmd ]] && (( max++ )) | |
elif (( REGION_ACTIVE == 2 )); then | |
local needle=$'\n' | |
# CURSOR and MARK are 0 indexed between letters like region_highlight | |
# Do not include the newline in the highlight | |
(( min = ${BUFFER[(Ib:min:)$needle]} )) | |
(( max = ${BUFFER[(ib:max:)$needle]} - 1 )) | |
fi | |
_zsh_highlight_apply_zle_highlight region standout "$min" "$max" | |
} | |
# yank / paste (zsh-5.1.1 and newer) | |
(( $+YANK_ACTIVE )) && (( YANK_ACTIVE )) && _zsh_highlight_apply_zle_highlight paste standout "$YANK_START" "$YANK_END" | |
# isearch | |
(( $+ISEARCHMATCH_ACTIVE )) && (( ISEARCHMATCH_ACTIVE )) && _zsh_highlight_apply_zle_highlight isearch underline "$ISEARCHMATCH_START" "$ISEARCHMATCH_END" | |
# suffix | |
(( $+SUFFIX_ACTIVE )) && (( SUFFIX_ACTIVE )) && _zsh_highlight_apply_zle_highlight suffix bold "$SUFFIX_START" "$SUFFIX_END" |
Work with zsh upstream to resolve this duplication.
See #418 (comment).