From 79f015eb7096ba89a8fa91570a81c69f859c0178 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sat, 29 Dec 2012 23:56:38 -0600 Subject: [PATCH] Fix the new lexer interaction when some of the lexer states were finished, but not all. Don't re-do them the next time around closes PR 13394 original commit: c818eb3ca3325fb7eac7f2a8105ea0121013214c --- collects/framework/private/color.rkt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/collects/framework/private/color.rkt b/collects/framework/private/color.rkt index eb882686..f26fa1f4 100644 --- a/collects/framework/private/color.rkt +++ b/collects/framework/private/color.rkt @@ -507,12 +507,22 @@ added get-regions (unless (andmap lexer-state-up-to-date? lexer-states) (begin-edit-sequence #f #f) (c-log "starting to color") - (set! re-tokenize-lses lexer-states) + (set! re-tokenize-lses (let loop ([lexer-states lexer-states]) + (cond + [(null? lexer-states) null] + [else (if (lexer-state-up-to-date? (car lexer-states)) + (loop (cdr lexer-states)) + lexer-states)]))) (define finished? (re-tokenize-move-to-next-ls (current-inexact-milliseconds) #f)) (c-log (format "coloring stopped ~a" (if finished? "because it finished" "with more to do"))) + (let loop ([states lexer-states]) + (unless (eq? re-tokenize-lses states) + (cond + [(null? states) (void)] + [else + (set-lexer-state-up-to-date?! (car states) #t) + (loop (cdr states))]))) (when finished? - (for ([ls (in-list lexer-states)]) - (set-lexer-state-up-to-date?! ls #t)) (update-lexer-state-observers) (c-log "updated observers")) (c-log "starting end-edit-sequence")