zsh-syntax-highlighting icon indicating copy to clipboard operation
zsh-syntax-highlighting copied to clipboard

Escaped variable-declaring reserved words are builtins

Open danielshahaf opened this issue 5 years ago • 1 comments

In BUFFER='\local a=( /* )', the word local is highlighted as a reserved word where it's in fact a builtin.

danielshahaf avatar Mar 17 '20 01:03 danielshahaf

Trace with current master (9ceb7c6e7c75183c20ac1ed51eb86c673fe3c808)::

⋮
+_zsh_highlight_main_highlighter_highlight_list:177> _zsh_highlight_main__type '\local' 1                                                                                                                           
+_zsh_highlight_main__type:1> integer -r aliases_allowed=1                                                                                                                                                          
+_zsh_highlight_main__type:7> integer may_cache=1                                                                                                                                                                   
+_zsh_highlight_main__type:10> ((  1  ))                                                                                                                                                                            
+_zsh_highlight_main__type:11> REPLY=none                                                                                                                                                                           
+_zsh_highlight_main__type:12> [[ -n none ]]                                                                                                                                                                        
+_zsh_highlight_main__type:13> return                                                                                                                                                                               
+_zsh_highlight_main_highlighter_highlight_list:178> local res=none                                                                                                                                                 
+_zsh_highlight_main_highlighter_highlight_list:179> [[ none == alias ]]                                                                                                                                            
+_zsh_highlight_main_highlighter_highlight_list:208> _zsh_highlight_main_highlighter_expand_path '\local'
+_zsh_highlight_main_highlighter_expand_path:2> ((  1 == 1  ))        
+_zsh_highlight_main_highlighter_expand_path:5> setopt localoptions nonomatch
+_zsh_highlight_main_highlighter_expand_path:6> unset REPLY         
+_zsh_highlight_main_highlighter_expand_path:7> : local         
+_zsh_highlight_main_highlighter_highlight_list:209> _zsh_highlight_main__type local 0                                                                                                                             
+_zsh_highlight_main__type:1> integer -r aliases_allowed=0        
+_zsh_highlight_main__type:7> integer may_cache=1   
+_zsh_highlight_main__type:10> ((  1  ))                     
+_zsh_highlight_main__type:11> REPLY=reserved                
+_zsh_highlight_main__type:12> [[ -n reserved ]]                         
+_zsh_highlight_main__type:13> return                                  
+_zsh_highlight_main_highlighter_highlight_list:210> res=reserved                   
+_zsh_highlight_main_highlighter_highlight_list:215> _zsh_highlight_main__is_redirection '\local'
⋮

danielshahaf avatar Mar 17 '20 01:03 danielshahaf