Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: search through alternative HISTFILE



Hi Peter,

Thanks a lot for the explanation, and the patch, it works perfectly! Based on your explanation however, I tried the following as well:

ACC_HISTFILE="${HOME}/.accumulated-history"

function accumulated-history-incremental-search-backward () {
    fc -p $ACC_HISTFILE
    HISTNO=$(( $( wc -l < $ACC_HISTFILE ) + 1 ))
    zle history-incremental-search-backward
    fc -P
}

i.e. before doing the search on the accumulated history, set the variable HISTNO to just beyond the last line of that history file. This also seems to work without the patch you provided, however I cannot really judge if there are any unintended side-effects with this approach.

Many thanks again for helping me out! I appreciate the effort.

Maarten



Messages sorted by: Reverse Date, Date, Thread, Author