From a90434b080318c343d9e4137e31bea631eedf767 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 1 Feb 2013 19:16:25 -0600 Subject: [PATCH] avoid a deadlock introduced in recent identifier highlighting commit --- collects/drracket/private/syncheck/gui.rkt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/collects/drracket/private/syncheck/gui.rkt b/collects/drracket/private/syncheck/gui.rkt index a147178382..9e870f615e 100644 --- a/collects/drracket/private/syncheck/gui.rkt +++ b/collects/drracket/private/syncheck/gui.rkt @@ -912,7 +912,7 @@ If the namespace does not, they are colored the unbound color. (not (eq? cursor-tooltip 'out-of-sync))] [else #f])) (when update-tooltip-frame-and-matching-identifiers? - (update-tooltip-frame-and-matching-identifiers)) + (update-tooltip-frame-and-matching-identifiers #t)) ;; update on a timer if the arrows changed (when (update-latent-arrows mouse-x mouse-y) (start-arrow-draw-timer syncheck-arrow-delay))) @@ -1101,7 +1101,7 @@ If the namespace does not, they are colored the unbound color. (set! cursor-eles latent-eles) (set! cursor-tooltip latent-tooltip) - (update-tooltip-frame-and-matching-identifiers) + (update-tooltip-frame-and-matching-identifiers #f) (update-docs-background cursor-eles) (unless (equal? latent-stuff cursor-stuff) (invalidate-bitmap-cache))) @@ -1221,9 +1221,9 @@ If the namespace does not, they are colored the unbound color. (make-rename-menu menu identifier-location-set/f)) (void)))) - (define/private (update-tooltip-frame-and-matching-identifiers) + (define/private (update-tooltip-frame-and-matching-identifiers refreshing?) (update-tooltip-frame) - (update-matching-identifiers)) + (update-matching-identifiers refreshing?)) (define tooltip-frame #f) (define/private (update-tooltip-frame) @@ -1238,7 +1238,7 @@ If the namespace does not, they are colored the unbound color. [_ (send tooltip-frame show #f)])) (define current-matching-identifiers (set)) - (define/private (update-matching-identifiers) + (define/private (update-matching-identifiers refreshing?) (define arrow-records (fetch-arrow-records cursor-text cursor-pos)) (define id-set (if arrow-records (let ([an-identifier-location-set @@ -1253,16 +1253,16 @@ If the namespace does not, they are colored the unbound color. (define clr "GreenYellow") (define style 'ellipse) (unless (equal? current-matching-identifiers id-set) - (define in-edit-sequence (list this)) - (begin-edit-sequence) + (define in-edit-sequence '()) (define (uh/highlight highlight?) (for ([lst (in-set current-matching-identifiers)]) (define txt (list-ref lst 0)) (define start (list-ref lst 1)) (define end (list-ref lst 2)) - (unless (member txt in-edit-sequence) - (set! in-edit-sequence (cons txt in-edit-sequence)) - (send txt begin-edit-sequence)) + (unless refreshing? + (unless (member txt in-edit-sequence) + (set! in-edit-sequence (cons txt in-edit-sequence)) + (send txt begin-edit-sequence))) (if highlight? (send txt highlight-range start end clr #f 'low style) (send txt unhighlight-range start end clr #f style))))