mirror of
				https://github.com/zsh-users/zsh-syntax-highlighting.git
				synced 2025-11-04 03:56:30 +00:00 
			
		
		
		
	main: Fold '!' handling in to the 'case'. No functional change.
This commit is contained in:
		
							parent
							
								
									0c9252ac69
								
							
						
					
					
						commit
						44b89f3307
					
				@ -689,11 +689,7 @@ _zsh_highlight_main_highlighter_highlight_list()
 | 
				
			|||||||
      case $res in
 | 
					      case $res in
 | 
				
			||||||
        reserved)       # reserved word
 | 
					        reserved)       # reserved word
 | 
				
			||||||
                        style=reserved-word
 | 
					                        style=reserved-word
 | 
				
			||||||
                        if [[ $arg == '!' && $this_word != *':start_of_pipeline:'* ]]; then
 | 
					                        # Match braces and handle special cases.
 | 
				
			||||||
                          style=unknown-token
 | 
					 | 
				
			||||||
                        fi
 | 
					 | 
				
			||||||
                        #
 | 
					 | 
				
			||||||
                        # Match braces.
 | 
					 | 
				
			||||||
                        case $arg in
 | 
					                        case $arg in
 | 
				
			||||||
                          ($'\x7b')
 | 
					                          ($'\x7b')
 | 
				
			||||||
                            braces_stack='Y'"$braces_stack"
 | 
					                            braces_stack='Y'"$braces_stack"
 | 
				
			||||||
@ -754,6 +750,14 @@ _zsh_highlight_main_highlighter_highlight_list()
 | 
				
			|||||||
                            #
 | 
					                            #
 | 
				
			||||||
                            # The repeat-count word will be handled like a redirection target.
 | 
					                            # The repeat-count word will be handled like a redirection target.
 | 
				
			||||||
                            this_word=':start::regular:'
 | 
					                            this_word=':start::regular:'
 | 
				
			||||||
 | 
					                            ;;
 | 
				
			||||||
 | 
					                          ('!')
 | 
				
			||||||
 | 
					                            if [[ $this_word != *':start_of_pipeline:'* ]]; then
 | 
				
			||||||
 | 
					                              style=unknown-token
 | 
				
			||||||
 | 
					                            else
 | 
				
			||||||
 | 
					                              # '!' reserved word at start of pipeline; style already set above
 | 
				
			||||||
 | 
					                            fi
 | 
				
			||||||
 | 
					                            ;;
 | 
				
			||||||
                        esac
 | 
					                        esac
 | 
				
			||||||
                        ;;
 | 
					                        ;;
 | 
				
			||||||
        'suffix alias') style=suffix-alias;;
 | 
					        'suffix alias') style=suffix-alias;;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user