These are the changes for being friendly with my path-saving zsh history

This commit is contained in:
Steven Lu 2013-07-08 23:30:16 -04:00
commit 40b792f513

View file

@ -434,6 +434,8 @@ function _history-substring-search-down-buffer() {
false false
} }
HISTORY_PATH_SEPARATOR="///; "
function _history-substring-search-up-history() { function _history-substring-search-up-history() {
# #
# Behave like up in ZSH, except clear the $BUFFER # Behave like up in ZSH, except clear the $BUFFER
@ -447,7 +449,8 @@ function _history-substring-search-up-history() {
# going up from somewhere below the top of history # going up from somewhere below the top of history
else else
zle up-history ((HISTNO--))
BUFFER=${history[$HISTNO]#*$HISTORY_PATH_SEPARATOR}
fi fi
return true return true
@ -470,7 +473,8 @@ function _history-substring-search-down-history() {
# going down from somewhere above the bottom of history # going down from somewhere above the bottom of history
else else
zle down-history ((HISTNO++))
BUFFER=${history[$HISTNO]#*$HISTORY_PATH_SEPARATOR}
fi fi
return true return true
@ -517,7 +521,7 @@ function _history-substring-search-up-search() {
# to highlight the current buffer. # to highlight the current buffer.
# #
(( _history_substring_search_match_index-- )) (( _history_substring_search_match_index-- ))
BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] BUFFER=${history[$_history_substring_search_matches[$_history_substring_search_match_index]]#*$HISTORY_PATH_SEPARATOR}
_history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND
elif [[ $_history_substring_search_match_index -eq 1 ]]; then elif [[ $_history_substring_search_match_index -eq 1 ]]; then