Skip to content

Commit

Permalink
fix paren coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
rfindler committed Jul 14, 2024
1 parent 96bf0fc commit e8490a6
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions gui-lib/framework/private/color.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -961,12 +961,19 @@ added get-regions
(define color (vector-ref paren-colors depth))
(cond
[(zero? invisible-paren-count)
(when (send (lexer-state-parens ls) is-open-pos? (- start (lexer-state-start-pos ls)))
(define-values (start-inner end-inner error-inner)
(send (lexer-state-parens ls) match-forward (- start (lexer-state-start-pos ls))))
(unless error-inner
(seq-loop (+ start-inner 1) (- end-inner 1) (+ depth 1))
(seq-loop (+ end-inner 1) (- end-position 1) depth)
(define-values (start-inner end-inner error-inner)
(send (lexer-state-parens ls) match-forward (- start (lexer-state-start-pos ls))))
(when (or (not (zero? invisible-paren-opens))
(not (zero? invisible-paren-closes))
start-inner)
(cond
[start-inner
(seq-loop (+ start-inner 1) (- end-inner 1) (+ depth 1))
(seq-loop (+ end-inner 1) (- end-position 1) depth)]
[else
(seq-loop (+ outermost-start 1) (- outermost-end 1) (+ depth 1))]))
(unless error-inner
(when (and start-inner end-inner)
(highlight ls start-inner end-inner caret-pos color priority)))]
[else
(define-values (start-inner end-inner error-inner)
Expand Down

0 comments on commit e8490a6

Please sign in to comment.