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