From aed99f6a3e9f29859682d92003731c75e43362e8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 30 Sep 2015 18:56:35 +0000 Subject: [PATCH] wrappers: Reimplement using Mikachu's zle-line-pre-redraw hook (workers/36650). --- zsh-syntax-highlighting.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 4caf3a8..02d45f9 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -49,6 +49,11 @@ if true; then fi fi +integer zsh_highlight_use_redrawhook +if zle -la .match-bracket; then + (( zsh_highlight_use_redrawhook=1 )) +fi + # ------------------------------------------------------------------------------------------------- # Core highlighting update system # ------------------------------------------------------------------------------------------------- @@ -357,6 +362,11 @@ _zsh_highlight_bind_widgets() done } +if (( $zsh_highlight_use_redrawhook )); then + _zsh_highlight_bind_widgets(){} + zle -N zle-line-pre-redraw _zsh_highlight +fi + # Load highlighters from directory. # # Arguments: