otherwise users are obliged to set the config values *after* sourcing
the plugin. They're not able to do it before. Also, re-sourcing the
plugin will reset the values to the defaults again.
A similar change was done in zsh-autosuggestions in the past:
https://github.com/zsh-users/zsh-autosuggestions/commit/9e4d3c3
* `HISTORY_SUBSTRING_SEARCH_PREFIX` is a global variable that defines
how the command history will be searched for your query. If set to a non-empty
value, only history prefixed by your query will be matched. For example,
if this variable is empty, `ls` will match `ls -l` and `echo ls`; if it is
non-empty, `ls` will only match `ls -l`.
Co-authored-by: Xue Qianming <qianmingxue@microsoft.com>
Don't suggest using $terminfo[kcuu1] or $terminfo[cuu1] lookups anymore!
Instead, have the user observe the actual key codes for their arrow keys
using `cat -v` and then use those observed values to create keybindings.
This should eliminate confusion and complaints about binding arrow keys.
See https://github.com/zsh-users/zsh-history-substring-search/issues/63
With HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE, it can take a while to compute
all unique search results, which would normally keep the shell unresponsive
during this computation.
This commit separates the retrieval of all history matches from the
computation of the matches that need to be presented to the user (unique
matches only if HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set). The
computation of the matches needing to be displayed is then done lazily,
and only when the user requests a new previously undisplayed result.
This keeps the response time fast while still enabling us to filter for
unique search results.