Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE force search unique result #162

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions zsh-history-substring-search.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,8 @@ _history_substring_search_process_raw_matches() {
#
# If HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set to a non-empty value,
# then ensure that only unique matches are presented to the user.
# When HIST_IGNORE_ALL_DUPS is set, ZSH already ensures a unique history,
# so in this case we do not need to do anything.
#
if [[ ! -o HIST_IGNORE_ALL_DUPS && -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then
if [[ -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then
#
# Get the actual history entry at the new index, and check if we have
# already added it to _history_substring_search_matches.
Expand Down