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
This commit is contained in:
Robby Findler 2012-12-29 23:56:38 -06:00
parent 2b98dcfe72
commit 79f015eb70

View File

@ -507,12 +507,22 @@ added get-regions
(unless (andmap lexer-state-up-to-date? lexer-states) (unless (andmap lexer-state-up-to-date? lexer-states)
(begin-edit-sequence #f #f) (begin-edit-sequence #f #f)
(c-log "starting to color") (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)) (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"))) (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? (when finished?
(for ([ls (in-list lexer-states)])
(set-lexer-state-up-to-date?! ls #t))
(update-lexer-state-observers) (update-lexer-state-observers)
(c-log "updated observers")) (c-log "updated observers"))
(c-log "starting end-edit-sequence") (c-log "starting end-edit-sequence")