Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pr/433'
Browse files Browse the repository at this point in the history
Note that there will be no zsh 5.3.2; zsh 5.3.1 will be followed
by 5.4.  There might be 5.4-test-1 pre-releases, though.

* upstream/pr/433:
  driver: Improve comment about ^r pattern match bug
  driver: Adjust zsh version for probing for pattern match bug
  README: Fix FAQ entry about isearch highlighting
  • Loading branch information
danielshahaf committed Jul 30, 2017
2 parents 39a6c47 + 3c43da5 commit b56ee54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,19 @@ syntax highlighting.

### Does syntax highlighting work during incremental history search?

Yes!
Highlighting the command line during an incremental history search (by default bound to
to <kbd>Ctrl+R</kbd> in zsh's emacs keymap) requires zsh 5.4 or newer.

If you're using `history-incremental-search-backward` (by default bound to <kbd>Ctrl+R</kbd>
in zsh's emacs keymap) then it works with _zsh version 5.3 and newer_.

If you're using `history-incremental-pattern-search-backward`, then syntax highlighting works
in _zsh 5.3.2 and newer_ due to [a bug in zsh](http:https://www.zsh.org/cgi-bin/mla/redirect?WORKERNUMBER=40285).

Under zsh 5.2 and older, the zsh-default [underlining][zshzle-Character-Highlighting]
Under zsh versions older than 5.4, the zsh-default [underlining][zshzle-Character-Highlighting]
of the matched portion of the buffer remains available, but zsh-syntax-highlighting's
additional highlighting is unavailable. (Those versions of zsh do not provide
enough information to allow computing the highlighting correctly.)

See [issue #288][i288] for details.
See issues [#288][i288] and [#415][i415] for details.

[zshzle-Character-Highlighting]: http:https://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
[i288]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/288
[i415]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/415

### How are new releases announced?

Expand Down
4 changes: 2 additions & 2 deletions zsh-syntax-highlighting.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fi
# Use workaround for bug in ZSH?
# zsh-users/zsh@48cadf4 http:https://www.zsh.org/mla/workers//2017/msg00034.html
autoload -U is-at-least
if is-at-least 5.3.2; then
if is-at-least 5.4; then
zsh_highlight__pat_static_bug=false
else
zsh_highlight__pat_static_bug=true
Expand All @@ -77,7 +77,7 @@ _zsh_highlight()
# Remove all highlighting in isearch, so that only the underlining done by zsh itself remains.
# For details see FAQ entry 'Why does syntax highlighting not work while searching history?'.
# This disables highlighting during isearch (for reasons explained in README.md) unless zsh is new enough
# and doesn't have the 5.3.1 bug
# and doesn't have the pattern matching bug
if [[ $WIDGET == zle-isearch-update ]] && { $zsh_highlight__pat_static_bug || ! (( $+ISEARCHMATCH_ACTIVE )) }; then
region_highlight=()
return $ret
Expand Down

0 comments on commit b56ee54

Please sign in to comment.