fix highlighting of query in matching commands
Without this commit, searching for "rebo" in "reboot" incorrectly causes "eboo" to be highlighted instead of "rebo".
This commit is contained in:
parent
53b70a0b82
commit
1022df5a5a
1 changed files with 3 additions and 3 deletions
|
|
@ -205,9 +205,9 @@ history-substring-search-highlight() {
|
||||||
# which indicates the end position of the first occurrence of
|
# which indicates the end position of the first occurrence of
|
||||||
# $history_substring_search_query_escaped in $BUFFER
|
# $history_substring_search_query_escaped in $BUFFER
|
||||||
: ${(S)BUFFER##(#m$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)($history_substring_search_query##)}
|
: ${(S)BUFFER##(#m$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)($history_substring_search_query##)}
|
||||||
let "history_substring_search_query_mbegin = $MEND - $#history_substring_search_query"
|
let "history_substring_search_query_mbegin = $MBEGIN - 1"
|
||||||
# this is slightly more informative than highlighting that fish performs
|
let "history_substring_search_query_mend = $history_substring_search_query_mbegin + $#history_substring_search_query"
|
||||||
region_highlight+=("$history_substring_search_query_mbegin $MEND $1")
|
region_highlight+=("$history_substring_search_query_mbegin $history_substring_search_query_mend $1")
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue