From e04f6ab862de39771427087334415398def71fe4 Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Fri, 17 Jun 2011 12:36:07 +0200 Subject: [PATCH] Safety checks before looking up cursor position --- zsh-syntax-highlighting.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 6d7736f..36e9fe7 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -110,7 +110,7 @@ _zsh_highlight_buffer_modified() # Returns 0 if the cursor has moved since _zsh_highlight was last called. _zsh_highlight_cursor_moved() { - (($_ZSH_HIGHLIGHT_PRIOR_CURSOR != $CURSOR)) + [[ -n $CURSOR ]] && [[ -n $_ZSH_HIGHLIGHT_PRIOR_CURSOR ]] && (($_ZSH_HIGHLIGHT_PRIOR_CURSOR != $CURSOR)) }