Skip to content

Commit 6d9065d

Browse files
committed
only use the irl colorer when in the module language
1 parent 601bc50 commit 6d9065d

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

drracket/drracket/private/module-language-tools.rkt

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -271,19 +271,20 @@
271271
(super tabify-all)))
272272

273273
(define/override (reset-console)
274-
(define ints-surrogate (get-surrogate))
275-
(when ints-surrogate
276-
;; when ints-surrogate is #f, then we
277-
;; should in a language other than the module
278-
;; language so we can safely skip this
279-
(define the-irl (send (get-definitions-text) get-irl))
280-
(send ints-surrogate set-get-token
281-
(call-read-language the-irl 'color-lexer (waive-option module-lexer)))
282-
(send ints-surrogate set-matches
283-
(call-read-language the-irl
284-
'drracket:paren-matches
285-
racket:default-paren-matches))
286-
(set-surrogate ints-surrogate))
274+
(when (send (get-definitions-text) get-in-module-language?)
275+
(define ints-surrogate (get-surrogate))
276+
(when ints-surrogate
277+
;; when ints-surrogate is #f, then we
278+
;; should in a language other than the module
279+
;; language so we can safely skip this
280+
(define the-irl (send (get-definitions-text) get-irl))
281+
(send ints-surrogate set-get-token
282+
(call-read-language the-irl 'color-lexer (waive-option module-lexer)))
283+
(send ints-surrogate set-matches
284+
(call-read-language the-irl
285+
'drracket:paren-matches
286+
racket:default-paren-matches))
287+
(set-surrogate ints-surrogate)))
287288
(super reset-console))
288289

289290
(super-new)))

0 commit comments

Comments
 (0)