mirror of
https://github.com/zsh-users/zsh-history-substring-search.git
synced 2026-11-11 19:51:49 -05:00
fix down-history after reaching the top of history
This commit is contained in:
committed by
Suraj N. Kurapati
parent
86bbedb993
commit
ca086b8999
@@ -354,10 +354,13 @@ _history-substring-search-up-history() {
|
|||||||
#
|
#
|
||||||
if [[ -z $_history_substring_search_query ]]; then
|
if [[ -z $_history_substring_search_query ]]; then
|
||||||
|
|
||||||
if [[ $HISTNO -gt 1 ]]; then
|
# we have reached the absolute top of history
|
||||||
zle up-history
|
if [[ $HISTNO -eq 1 ]]; then
|
||||||
else
|
|
||||||
BUFFER=''
|
BUFFER=''
|
||||||
|
|
||||||
|
# going up from somewhere below the top of history
|
||||||
|
else
|
||||||
|
zle up-history
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return true
|
return true
|
||||||
@@ -373,10 +376,14 @@ _history-substring-search-down-history() {
|
|||||||
#
|
#
|
||||||
if [[ -z $_history_substring_search_query ]]; then
|
if [[ -z $_history_substring_search_query ]]; then
|
||||||
|
|
||||||
if [[ $HISTNO -le $#history ]]; then
|
# going down from the absolute top of history
|
||||||
zle down-history
|
if [[ $HISTNO -eq 1 && -z $BUFFER ]]; then
|
||||||
|
BUFFER=${history[1]}
|
||||||
|
_history_substring_search_move_cursor_eol=true
|
||||||
|
|
||||||
|
# going down from somewhere above the bottom of history
|
||||||
else
|
else
|
||||||
BUFFER=''
|
zle down-history
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user