adjustments to the colorer-out-of-sync gizmo

(the "()" in the bottom right of the drracket window)
  to make sure that it is right when switching tabs
  and when a frame is first opened
This commit is contained in:
Robby Findler 2011-01-22 14:50:42 -06:00
parent cef9f90c27
commit 0fe0858ba8
3 changed files with 10 additions and 1 deletions

View File

@ -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?)

View File

@ -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

View File

@ -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