don't let syntax-colorer thread get suspend while reading from the editor

svn: r14531
This commit is contained in:
Matthew Flatt 2009-04-16 19:20:44 +00:00
parent 709ad23400
commit ce9d264920

View File

@ -260,7 +260,11 @@ added get-regions
(define/private (re-tokenize ls in in-start-pos enable-suspend) (define/private (re-tokenize ls in in-start-pos enable-suspend)
(let-values ([(lexeme type data new-token-start new-token-end) (let-values ([(lexeme type data new-token-start new-token-end)
(get-token in)]) (begin
(enable-suspend #f)
(begin0
(get-token in)
(enable-suspend #t)))])
(unless (eq? 'eof type) (unless (eq? 'eof type)
(enable-suspend #f) (enable-suspend #f)
#; (printf "~a at ~a to ~a~n" lexeme (+ in-start-pos (sub1 new-token-start)) #; (printf "~a at ~a to ~a~n" lexeme (+ in-start-pos (sub1 new-token-start))
@ -365,10 +369,14 @@ added get-regions
(for-each (for-each
(lambda (ls) (lambda (ls)
(re-tokenize ls (re-tokenize ls
(open-input-text-editor this (begin
(lexer-state-current-pos ls) (enable-suspend #f)
(lexer-state-end-pos ls) (begin0
(λ (x) #f)) (open-input-text-editor this
(lexer-state-current-pos ls)
(lexer-state-end-pos ls)
(λ (x) #f))
(enable-suspend #t)))
(lexer-state-current-pos ls) (lexer-state-current-pos ls)
enable-suspend)) enable-suspend))
lexer-states))))) lexer-states)))))