From 95f6cbc223e29135b84cb152d0aef5a3568a5b9f 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 9f0b7f4..542bc96 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 2e818d8..f0086f8 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -411,7 +411,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