main: Fix end of buffer check for path_prefix with non-null PREBUFFER
This commit is contained in:
parent
2c0c75a8ee
commit
d2c8f3a56d
@ -229,7 +229,6 @@ _zsh_highlight_highlighter_main_paint()
|
|||||||
local -a options_to_set # used in callees
|
local -a options_to_set # used in callees
|
||||||
local buf="$PREBUFFER$BUFFER"
|
local buf="$PREBUFFER$BUFFER"
|
||||||
integer len="${#buf}"
|
integer len="${#buf}"
|
||||||
integer pure_buf_len=$(( len - ${#PREBUFFER} )) # == $#BUFFER, used e.g. in *_check_path
|
|
||||||
|
|
||||||
# "R" for round
|
# "R" for round
|
||||||
# "Q" for square
|
# "Q" for square
|
||||||
@ -788,7 +787,7 @@ _zsh_highlight_main_highlighter_check_path()
|
|||||||
[[ ! -d ${expanded_path:h} ]] && return 1
|
[[ ! -d ${expanded_path:h} ]] && return 1
|
||||||
|
|
||||||
# If this word ends the buffer, check if it's the prefix of a valid path.
|
# If this word ends the buffer, check if it's the prefix of a valid path.
|
||||||
if [[ ${BUFFER[1]} != "-" && $pure_buf_len == $end_pos ]] &&
|
if [[ ${BUFFER[1]} != "-" && $len == $end_pos ]] &&
|
||||||
[[ $WIDGET != zle-line-finish ]]; then
|
[[ $WIDGET != zle-line-finish ]]; then
|
||||||
local -a tmp
|
local -a tmp
|
||||||
tmp=( ${expanded_path}*(N) )
|
tmp=( ${expanded_path}*(N) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user