From 71e797a8b5a3adfb7adeff93fcf158b101e6cca6 Mon Sep 17 00:00:00 2001 From: Guido Date: Thu, 16 Jun 2011 13:57:34 -0700 Subject: [PATCH] Much easier and less error prone way to start highlighting immediately after the creation of a new command line. --- zsh-syntax-highlighting.zsh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 60eb864..0d80711 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -174,13 +174,5 @@ unset highlighter highlighter_dir highlighters_dir [[ $#ZSH_HIGHLIGHT_HIGHLIGHTERS -eq 0 ]] && ZSH_HIGHLIGHT_HIGHLIGHTERS=(main) # workaround to start highlighting immediately after the creation of a new command line. -if [[ $#functions[zle-line-init] -eq 0 ]]; then - _zsh_highlight_old_zle_line_init_definition=$functions[zle-line-init] - - function zle-line-init() { - eval $_zsh_highlight_old_zle_line_init_definition - _zsh_highlight - } -fi - -zle -N zle-line-init +_zsh_highlight_old_precmd_definition=$functions[precmd] +functions[precmd]="$_zsh_highlight_old_precmd_definition"";""_zsh_highlight"