GH-44: fix "parameter not set" warning by set -u

$ zsh -f
zsh% set -u
zsh% source zsh-history-substring-search.zsh
zsh% bindkey '^[[A' history-substring-search-up
zsh% bindkey '^[[B' history-substring-search-down
zsh% so<up>
_history-substring-search-begin:11: _history_substring_search_result: parameter not set
This commit is contained in:
Suraj N. Kurapati 2016-07-16 09:25:50 -07:00
parent 434fabd55e
commit 6008552895

View file

@ -186,7 +186,7 @@ _history-substring-search-begin() {
# search result, then just keep stepping through the match list. Otherwise # search result, then just keep stepping through the match list. Otherwise
# start a new search. # start a new search.
# #
if [[ -n $BUFFER && $BUFFER == $_history_substring_search_result ]]; then if [[ -n $BUFFER && $BUFFER == ${_history_substring_search_result:-} ]]; then
return; return;
fi fi