Browse Source

noop: Rename a local variable for clarity.

pull/232/head
Daniel Shahaf 9 years ago
parent
commit
fb5ce43799
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      highlighters/main/main-highlighter.zsh

+ 6
- 6
highlighters/main/main-highlighter.zsh View File

@ -102,11 +102,11 @@ _zsh_highlight_main_highlighter()
) )
for arg in ${(z)buf}; do for arg in ${(z)buf}; do
# substr_color is set to 1 to disable adding an entry to region_highlight
# $already_added is set to 1 to disable adding an entry to region_highlight
# for this iteration. Currently, that is done for "" and $'' strings, # for this iteration. Currently, that is done for "" and $'' strings,
# which add the entry early so escape sequences within the string override # which add the entry early so escape sequences within the string override
# the string's color. # the string's color.
integer substr_color=0
integer already_added=0
local style_override="" local style_override=""
if $new_expression && [[ $arg = 'noglob' ]]; then if $new_expression && [[ $arg = 'noglob' ]]; then
highlight_glob=false highlight_glob=false
@ -195,7 +195,7 @@ _zsh_highlight_main_highlighter()
# is how [[ ... ]] is highlighted, too. # is how [[ ... ]] is highlighted, too.
style=$ZSH_HIGHLIGHT_STYLES[reserved-word] style=$ZSH_HIGHLIGHT_STYLES[reserved-word]
_zsh_highlight_main_add_region_highlight $start_pos $((start_pos + 2)) $style _zsh_highlight_main_add_region_highlight $start_pos $((start_pos + 2)) $style
substr_color=1
already_added=1
else else
if _zsh_highlight_main_highlighter_check_path; then if _zsh_highlight_main_highlighter_check_path; then
style=$ZSH_HIGHLIGHT_STYLES[path] style=$ZSH_HIGHLIGHT_STYLES[path]
@ -218,12 +218,12 @@ _zsh_highlight_main_highlighter()
'"'*) style=$ZSH_HIGHLIGHT_STYLES[double-quoted-argument] '"'*) style=$ZSH_HIGHLIGHT_STYLES[double-quoted-argument]
_zsh_highlight_main_add_region_highlight $start_pos $end_pos $style _zsh_highlight_main_add_region_highlight $start_pos $end_pos $style
_zsh_highlight_main_highlighter_highlight_string _zsh_highlight_main_highlighter_highlight_string
substr_color=1
already_added=1
;; ;;
\$\'*) style=$ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument] \$\'*) style=$ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]
_zsh_highlight_main_add_region_highlight $start_pos $end_pos $style _zsh_highlight_main_add_region_highlight $start_pos $end_pos $style
_zsh_highlight_main_highlighter_highlight_dollar_string _zsh_highlight_main_highlighter_highlight_dollar_string
substr_color=1
already_added=1
;; ;;
'`'*) style=$ZSH_HIGHLIGHT_STYLES[back-quoted-argument];; '`'*) style=$ZSH_HIGHLIGHT_STYLES[back-quoted-argument];;
[*?]*|*[^\\][*?]*) [*?]*|*[^\\][*?]*)
@ -247,7 +247,7 @@ _zsh_highlight_main_highlighter()
fi fi
# if a style_override was set (eg in _zsh_highlight_main_highlighter_check_path), use it # if a style_override was set (eg in _zsh_highlight_main_highlighter_check_path), use it
[[ -n $style_override ]] && style=$ZSH_HIGHLIGHT_STYLES[$style_override] [[ -n $style_override ]] && style=$ZSH_HIGHLIGHT_STYLES[$style_override]
[[ $substr_color = 0 ]] && _zsh_highlight_main_add_region_highlight $start_pos $end_pos $style
(( already_added )) || _zsh_highlight_main_add_region_highlight $start_pos $end_pos $style
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS:#"$arg"} ]] && new_expression=true [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS:#"$arg"} ]] && new_expression=true
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]] && highlight_glob=true [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]] && highlight_glob=true
start_pos=$end_pos start_pos=$end_pos

Loading…
Cancel
Save