diff --git a/collects/drracket/private/unit.rkt b/collects/drracket/private/unit.rkt index 10a3f226ca..95a45e4148 100644 --- a/collects/drracket/private/unit.rkt +++ b/collects/drracket/private/unit.rkt @@ -2810,6 +2810,7 @@ module browser threading seems wrong. definitions-canvases) (for-each (λ (ints-canvas) (send ints-canvas refresh)) interactions-canvases) + (set-color-status! (send definitions-text is-lexer-valid?)) (end-container-sequence))) (define/pubment (on-tab-change from-tab to-tab) @@ -4122,6 +4123,10 @@ module browser threading seems wrong. (set-label-prefix (string-constant drscheme)) (set! newest-frame this) + ;; a callback might have happened that initializes set-color-status! before the + ;; definitions text is connected to the frame, so we do an extra initialization + ;; now, once we know we have the right connection + (set-color-status! (send definitions-text is-lexer-valid?)) (send definitions-canvas focus))) ;; get-define-popup-name : (or/c #f (cons/c string? string?) (list/c string? string? string)) boolean -> (or/c #f string?) diff --git a/collects/framework/private/color.rkt b/collects/framework/private/color.rkt index 1b5c0f9e86..f7be4ce51e 100644 --- a/collects/framework/private/color.rkt +++ b/collects/framework/private/color.rkt @@ -137,7 +137,6 @@ added get-regions (new paren-tree% (matches pairs)))) (define lexer-states (list (make-new-lexer-state 0 'end))) - (define/public (get-up-to-date?) (andmap lexer-state-up-to-date? lexer-states)) @@ -246,6 +245,7 @@ added get-regions (on-lexer-valid lexers-all-valid?))) (define/pubment (on-lexer-valid valid?) (inner (void) on-lexer-valid valid?)) + (define/public-final (is-lexer-valid?) lexers-all-valid?) (define/private (reset-tokens) (for-each diff --git a/collects/scribblings/framework/color.scrbl b/collects/scribblings/framework/color.scrbl index 2b727ac87d..979155fa5c 100644 --- a/collects/scribblings/framework/color.scrbl +++ b/collects/scribblings/framework/color.scrbl @@ -229,6 +229,10 @@ The default method just returns @racket[(void)]. } + @defmethod[#:mode public-final (is-lexer-valid?) boolean?]{ + Indicates if the lexer is currently valid for this editor. + } + } @defmixin[color:text-mixin (text:basic<%>) (color:text<%>)]{ Adds the functionality needed for on-the-fly coloring and parenthesis