Safety checks before looking up cursor position

This commit is contained in:
Julien Nicoulaud 2011-06-17 12:36:07 +02:00
parent f6af27b8a6
commit e04f6ab862

View File

@ -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))
}