mirror of
https://github.com/zsh-users/zsh-history-substring-search
synced 2024-09-20 08:09:05 +02:00
Quote variable to highlight right words on zsh 4.3
When the variable is not quoted, there seems to be some difference in evaluating the line between zsh 4.3 and 5.6
This commit is contained in:
parent
36505c46c7
commit
19cb0eb8be
|
@ -324,7 +324,7 @@ _history-substring-search-end() {
|
|||
for query_part in $_history_substring_search_query_parts; do
|
||||
local escaped_query_part=${query_part//(#m)[\][()|\\*?#<>~^]/\\$MATCH}
|
||||
# (i) get index of pattern
|
||||
local query_part_match_index=${${BUFFER:$highlight_start_index}[(i)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)${escaped_query_part}]}
|
||||
local query_part_match_index="${${BUFFER:$highlight_start_index}[(i)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)${escaped_query_part}]}"
|
||||
if [[ $query_part_match_index -le ${#BUFFER:$highlight_start_index} ]]; then
|
||||
highlight_start_index=$(( $highlight_start_index + $query_part_match_index ))
|
||||
highlight_end_index=$(( $highlight_start_index + ${#query_part} ))
|
||||
|
|
Loading…
Reference in a new issue