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