From 52ece975c393f5f7e1d2bbfecb19124fc696f918 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 2 Sep 2015 02:37:43 +0000 Subject: [PATCH] Update comments. No functional change. --- highlighters/main/main-highlighter.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 2c9120a..f5711c9 100755 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -70,8 +70,8 @@ _zsh_highlight_main_add_region_highlight() { (( start -= $#PREBUFFER )) (( end -= $#PREBUFFER )) - (( end < 0 )) && return # bug - (( start < 0 )) && start=0 # normal with e.g. multiline strings + (( end < 0 )) && return # having end<0 would be a bug + (( start < 0 )) && start=0 # having start<0 is normal with e.g. multiline strings region_highlight+=("$start $end $style") } @@ -102,6 +102,7 @@ _zsh_highlight_main_highlighter() local substr_color=0 local style_override="" [[ $start_pos -eq 0 && $arg = 'noglob' ]] && highlight_glob=false + # advance $start_pos, skipping over whitespace in $buf. ((start_pos+=${#buf[$start_pos+1,-1]}-${#${buf[$start_pos+1,-1]##([[:space:]]|\\[[:space:]])#}})) ((end_pos=$start_pos+${#arg}))