Skip to content

Commit

Permalink
Escape glob chars in histfindnodups mode
Browse files Browse the repository at this point in the history
Fixes #362.
  • Loading branch information
marlonrichert committed Oct 26, 2021
1 parent 1c88317 commit 0e8aca6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/completion/_autocomplete.history_lines
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ _autocomplete.history_lines() {
fi
if [[ -o histfindnodups ]]; then
while (( $#events[@] < max_lines && 0 < histno && histno < HISTNO )); do
[[ -v history[$histno] && ! -v events[$history[$histno]] ]] &&
# -v's arg is a literal string, so we need to escape glob chars.
[[ -v history[$histno] && ! -v events[${(b)history[$histno]}] ]] &&
events[$history[$histno]]=$histno
(( histno += inc ))
done
Expand Down

0 comments on commit 0e8aca6

Please sign in to comment.