From 721cdba2c1673c9c8f7ba92def48332911dc85b9 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 2 Oct 2011 10:18:36 -0500 Subject: [PATCH] adjst check syntax so that it only clears out style changes when clicking 'Run' (style changes are not applied when running online check syntax) --- collects/drracket/private/syncheck/gui.rkt | 19 ++++++++++++++----- .../private/syncheck/local-member-names.rkt | 1 + collects/scribblings/tools/unit.scrbl | 3 ++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/collects/drracket/private/syncheck/gui.rkt b/collects/drracket/private/syncheck/gui.rkt index f5a744456d..8f7725a8ba 100644 --- a/collects/drracket/private/syncheck/gui.rkt +++ b/collects/drracket/private/syncheck/gui.rkt @@ -486,14 +486,17 @@ If the namespace does not, they are colored the unbound color. (set! last-known-mouse-y #f) (set! tacked-hash-table #f) (set! arrow-records #f) - (when cleanup-texts - (for-each (λ (text) (send text thaw-colorer)) - cleanup-texts)) - (set! cleanup-texts #f) + (syncheck:clear-coloring) (set! style-mapping #f) (syncheck:update-drawn-arrows) (invalidate-bitmap-cache))) + (define/public (syncheck:clear-coloring) + (when cleanup-texts + (for-each (λ (text) (send text thaw-colorer)) + cleanup-texts)) + (set! cleanup-texts #f)) + ;; syncheck:apply-style/remember : (is-a?/c text%) number number style% symbol -> void (define/public (syncheck:apply-style/remember txt start finish style mode) (when (eq? mode syncheck-mode) @@ -1377,7 +1380,12 @@ If the namespace does not, they are colored the unbound color. (define/augment (clear-annotations) (inner (void) clear-annotations) (syncheck:clear-error-message) - (syncheck:clear-highlighting)) + ;; we only clear out the highlighting that check syntax + ;; may have introduced here; we don't reset the arrows + ;; (or other mouse-over stuff) + ;; this code is also run by syncheck:clear-arrows, which + ;; used to be called here (indirectly by syncheck:clear-highlighting) + (send (get-defs) syncheck:clear-coloring)) (define/public (syncheck:clear-error-message) (send report-error-text clear-output-ports) @@ -1804,6 +1812,7 @@ If the namespace does not, they are colored the unbound color. (λ () (send the-tab clear-annotations) (send the-tab reset-offer-kill) + (send the-tab syncheck:clear-highlighting) (send (send the-tab get-defs) syncheck:init-arrows) (drracket:eval:expand-program #:gui-modules? #f diff --git a/collects/drracket/private/syncheck/local-member-names.rkt b/collects/drracket/private/syncheck/local-member-names.rkt index b8a0adf767..e3d6c4316c 100644 --- a/collects/drracket/private/syncheck/local-member-names.rkt +++ b/collects/drracket/private/syncheck/local-member-names.rkt @@ -5,6 +5,7 @@ (define-local-member-name syncheck:init-arrows syncheck:clear-arrows + syncheck:clear-coloring syncheck:arrows-visible? syncheck:find-source-object diff --git a/collects/scribblings/tools/unit.scrbl b/collects/scribblings/tools/unit.scrbl index 5d271d1625..89caa2c932 100644 --- a/collects/scribblings/tools/unit.scrbl +++ b/collects/scribblings/tools/unit.scrbl @@ -168,7 +168,8 @@ The base class that implements the tab's functionality. @defmethod[#:mode override (clear-annotations) void?]{ - Clears any error highlighting. + Clears any error highlighting; calls + @method[drracket:rep:context<%> clear-annotations]. } }