zsh-users / zaw

zsh anything.el-like widget.
BSD 3-Clause "New" or "Revised" License
572 stars 67 forks source link

hist_find_no_dups randomizes history entries order #71

Closed mikea closed 8 years ago

mikea commented 9 years ago

After https://github.com/zsh-users/zaw/commit/5e466526d8abc1865691d238b660b2a8591b61fc hist_find_no_dups randomizes entries order, which is terribly inconvenient. The order of entries should always have more recent items on top.

willghatch commented 9 years ago

I agree that would be better, but it might be difficult to get rid of duplicates and keep the order. Or it might be easy and I just don't know the solution. At any rate, I personally don't plan on making unique-ness and ordering both work together right now. Are you wanting both, or just not wanting the option hist_find_no_dups (that configures something else) to affect the ordering? We could make a different zaw-specific option to just force history uniqueness, rather than hijacking the built-in option.

junkblocker commented 9 years ago

:+1: to order being important than no dupes.

willghatch commented 8 years ago

zaw now uses a zstyle to decide whether or not to ignore duplicates instead of the built-in zsh setting, so you can choose which you want zaw to do irrespective of what other parts of zsh do.

balta2ar commented 8 years ago

but it might be difficult to get rid of duplicates and keep the order

@willghatch Algorithmically it can be done as follows: http://unix.stackexchange.com/a/84838/44493

willghatch commented 8 years ago

Fixed in #81.