Merge remote-tracking branch 'danielsh/m0vie-i288-v2' (revised version of upstream/pr/288)

* danielsh/m0vie-i288-v2:
  driver: Don't highlight in isearch
  driver: Always bind zle-line-finish and use it instead of accept-*
  driver: Widget binding: Support binding incomplete/nonexistent widgets
This commit is contained in:
Daniel Shahaf
2016-07-29 21:09:31 +00:00
5 changed files with 53 additions and 11 deletions

View File

@@ -62,9 +62,8 @@
# Whether the highlighter should be called or not.
_zsh_highlight_main_highlighter_predicate()
{
# accept-* may trigger removal of path_prefix highlighting
[[ $WIDGET == accept-* ]] ||
_zsh_highlight_buffer_modified
# may need to remove path_prefix highlighting when the line ends
[[ $WIDGET == zle-line-finish ]] || _zsh_highlight_buffer_modified
}
# Helper to deal with tokens crossing line boundaries.
@@ -596,7 +595,7 @@ _zsh_highlight_main_highlighter_check_path()
# If this word ends the buffer, check if it's the prefix of a valid path.
if [[ ${BUFFER[1]} != "-" && ${#BUFFER} == $end_pos ]] &&
[[ $WIDGET != accept-* ]]; then
[[ $WIDGET != zle-line-finish ]]; then
local -a tmp
tmp=( ${expanded_path}*(N) )
(( $#tmp > 0 )) && REPLY=path_prefix && return 0

View File

@@ -31,7 +31,7 @@
# Related to path_prefix.zsh
BUFFER='ls /bin/s'
WIDGET=accept-line
WIDGET=zle-line-finish
expected_region_highlight=(
"4 9 default" # /bin/s