Highlight yanks/pastes on top of syntax highlighting.
Let $zle_highlight[paste] override $region_highlight.
This commit is contained in:
parent
0e31d6e1a2
commit
e5c2a88db0
@ -106,6 +106,21 @@ _zsh_highlight()
|
|||||||
region_highlight+=("$start $end $region")
|
region_highlight+=("$start $end $region")
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
# YANK_ACTIVE is only available in zsh-5.1.1 and newer
|
||||||
|
(( $+YANK_ACTIVE )) && () {
|
||||||
|
if (( YANK_ACTIVE )) ; then
|
||||||
|
# zle_highlight[paste] defaults to 'standout' if unspecified
|
||||||
|
local paste="${${zle_highlight[(r)paste:*]#paste:}:-standout}"
|
||||||
|
integer start end
|
||||||
|
if (( YANK_END > YANK_START )) ; then
|
||||||
|
start=$YANK_START end=$YANK_END
|
||||||
|
else
|
||||||
|
start=$YANK_END end=$YANK_START
|
||||||
|
fi
|
||||||
|
region_highlight+=("$start $end $paste")
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} always {
|
} always {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user