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
}
HISTORY_PATH_SEPARATOR="///; "
function _history-substring-search-up-history() {
#
# 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
else
zle up-history
((HISTNO--))
BUFFER=${history[$HISTNO]#*$HISTORY_PATH_SEPARATOR}
fi
return true
@ -470,7 +473,8 @@ function _history-substring-search-down-history() {
# going down from somewhere above the bottom of history
else
zle down-history
((HISTNO++))
BUFFER=${history[$HISTNO]#*$HISTORY_PATH_SEPARATOR}
fi
return true
@ -517,7 +521,7 @@ function _history-substring-search-up-search() {
# to highlight the current buffer.
#
(( _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
elif [[ $_history_substring_search_match_index -eq 1 ]]; then