From 40b792f513b5b3823c78a2afc85078c576440701 Mon Sep 17 00:00:00 2001 From: Steven Lu Date: Mon, 8 Jul 2013 23:30:16 -0400 Subject: [PATCH] These are the changes for being friendly with my path-saving zsh history --- .../history-substring-search.zsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh index ef3a73539..53b1b429b 100644 --- a/plugins/history-substring-search/history-substring-search.zsh +++ b/plugins/history-substring-search/history-substring-search.zsh @@ -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