brackets: Disallow negative nesting level
This commit is contained in:
		
							parent
							
								
									ac90970edc
								
							
						
					
					
						commit
						9dcfacc4a5
					
				|  | @ -59,12 +59,16 @@ _zsh_highlight_highlighter_brackets_paint() | ||||||
|         lastoflevel[$level]=$pos |         lastoflevel[$level]=$pos | ||||||
|         ;; |         ;; | ||||||
|       [")]}"]) |       [")]}"]) | ||||||
|  |         if (( level > 0 )); then | ||||||
|           matchingpos=$lastoflevel[$level] |           matchingpos=$lastoflevel[$level] | ||||||
|           levelpos[$pos]=$((level--)) |           levelpos[$pos]=$((level--)) | ||||||
|           if _zsh_highlight_brackets_match $matchingpos $pos; then |           if _zsh_highlight_brackets_match $matchingpos $pos; then | ||||||
|             matching[$matchingpos]=$pos |             matching[$matchingpos]=$pos | ||||||
|             matching[$pos]=$matchingpos |             matching[$pos]=$matchingpos | ||||||
|           fi |           fi | ||||||
|  |         else | ||||||
|  |           levelpos[$pos]=-1 | ||||||
|  |         fi | ||||||
|         ;; |         ;; | ||||||
|       ['"'\']) |       ['"'\']) | ||||||
|         # Skip everything inside quotes |         # Skip everything inside quotes | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue