GH-10: clear highlights before displaying result
This commit is contained in:
parent
527f95fee9
commit
226ae9a368
1 changed files with 8 additions and 6 deletions
|
|
@ -179,7 +179,7 @@ fi
|
||||||
function _history-substring-search-begin() {
|
function _history-substring-search-begin() {
|
||||||
setopt localoptions extendedglob
|
setopt localoptions extendedglob
|
||||||
|
|
||||||
_history_substring_search_move_cursor_eol=false
|
_history_substring_search_refresh_display=false
|
||||||
_history_substring_search_query_highlight=
|
_history_substring_search_query_highlight=
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
@ -249,8 +249,10 @@ function _history-substring-search-end() {
|
||||||
|
|
||||||
_history_substring_search_result=$BUFFER
|
_history_substring_search_result=$BUFFER
|
||||||
|
|
||||||
# move the cursor to the end of the command line
|
# the search was succesful so display the result properly by clearing away
|
||||||
if [[ $_history_substring_search_move_cursor_eol == true ]]; then
|
# existing highlights and moving the cursor to the end of the result buffer
|
||||||
|
if [[ $_history_substring_search_refresh_display == true ]]; then
|
||||||
|
region_highlight=()
|
||||||
CURSOR=${#BUFFER}
|
CURSOR=${#BUFFER}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -368,7 +370,7 @@ function _history-substring-search-down-history() {
|
||||||
# going down from the absolute top of history
|
# going down from the absolute top of history
|
||||||
if [[ $HISTNO -eq 1 && -z $BUFFER ]]; then
|
if [[ $HISTNO -eq 1 && -z $BUFFER ]]; then
|
||||||
BUFFER=${history[1]}
|
BUFFER=${history[1]}
|
||||||
_history_substring_search_move_cursor_eol=true
|
_history_substring_search_refresh_display=true
|
||||||
|
|
||||||
# going down from somewhere above the bottom of history
|
# going down from somewhere above the bottom of history
|
||||||
else
|
else
|
||||||
|
|
@ -382,7 +384,7 @@ function _history-substring-search-down-history() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _history-substring-search-up-search() {
|
function _history-substring-search-up-search() {
|
||||||
_history_substring_search_move_cursor_eol=true
|
_history_substring_search_refresh_display=true
|
||||||
|
|
||||||
#
|
#
|
||||||
# Highlight matches during history-substring-up-search:
|
# Highlight matches during history-substring-up-search:
|
||||||
|
|
@ -461,7 +463,7 @@ function _history-substring-search-up-search() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _history-substring-search-down-search() {
|
function _history-substring-search-down-search() {
|
||||||
_history_substring_search_move_cursor_eol=true
|
_history_substring_search_refresh_display=true
|
||||||
|
|
||||||
#
|
#
|
||||||
# Highlight matches during history-substring-up-search:
|
# Highlight matches during history-substring-up-search:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue