From f3bb215c76bb69ad28c19748da75921809ff524b Mon Sep 17 00:00:00 2001 From: Arnaud Venturi Date: Fri, 21 Jul 2017 21:30:26 +1000 Subject: [PATCH] Checking if _zsh_highlight exists before calling it --- src/widgets.zsh | 6 +++++- zsh-autosuggestions.zsh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/widgets.zsh b/src/widgets.zsh index bf62fb3..ccd0b6d 100644 --- a/src/widgets.zsh +++ b/src/widgets.zsh @@ -135,7 +135,11 @@ _zsh_autosuggest_accept() { fi _zsh_autosuggest_invoke_original_widget $@ - _zsh_highlight + + # If zsh-syntax-highlighting is installed, we need to refresh the highlighting here + if [ `whence _zsh_highlight` ]; then + _zsh_highlight + fi } # Accept the entire suggestion and execute it diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index c980732..0f6bb1a 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -400,7 +400,11 @@ _zsh_autosuggest_accept() { fi _zsh_autosuggest_invoke_original_widget $@ - _zsh_highlight + + # If zsh-syntax-highlighting is installed, we need to refresh the highlighting here + if [ `whence _zsh_highlight` ]; then + _zsh_highlight + fi } # Accept the entire suggestion and execute it