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

Re: [PATCH] isearch: do not use PAT_STATIC since we call zle hooks



m0viefreak wrote on Fri, Jan 06, 2017 at 17:25:41 +0000:
> Minimal reproducing example:
> 
> % bindkey '^R' history-incremental-pattern-search-backward
> % evil_hook() { a=(); : ${a[(r)foo*]}; };
> % zle -N zle-isearch-update evil_hook
> % : foo
> % : bar
> % : baz
> %
> 
> type: <^R>b
> % : baz
> bck-i-search: b_
> 
> type: <^R>
> % : foo
> bck-i-search: b_
> 
> ': foo' is found instead of ': bar' because evil_hook modified the
> static pattern used in isearch.
> 
> Related: zsh-syntax-highlighting issue which found this bug:
> https://github.com/zsh-users/zsh-syntax-highlighting/issues/407

Is there a way to probe for this bug at runtime?  I.e., a way for
a script to determine whether the zsh binary that interprets it has or
hasn't this bug?

We need this in z-sy-h to choose between two codepaths (and we'd
rather not use is-at-least in case distros backport m0vie's patch).

Thanks,

Daniel



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