From f66ff0556ac8c0dcc3616d002eb77f8c52507c84 Mon Sep 17 00:00:00 2001 From: Charles Gueunet Date: Wed, 17 Apr 2019 22:54:56 +0200 Subject: [PATCH] fix(error): key with now impact on text When pressing esc (to go out of vim insert mode), the function was trigger with an empty string leading to an annoying permission denied. --- zsh-syntax-highlighting-filetypes.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh-syntax-highlighting-filetypes.zsh b/zsh-syntax-highlighting-filetypes.zsh index c6eb94d..e89ce60 100644 --- a/zsh-syntax-highlighting-filetypes.zsh +++ b/zsh-syntax-highlighting-filetypes.zsh @@ -78,7 +78,7 @@ _zsh_highlight-zle-buffer-p() { local region_highlight_size="$1" highlight_predicate="$2" # If any highlightings are not taken into account, asume it is needed. # This holds for some up/down-history commands, for example. - ((region_highlight_size == 0)) || "$highlight_predicate" + ((region_highlight_size == 0)) || [[ -n "$highlight_predicate" ]] && "$highlight_predicate" } # Whether the command line buffer is modified or not.