Make Performance Report work on unsaved editors.
This commit is contained in:
parent
e07de3947b
commit
ce32003de2
|
@ -33,6 +33,9 @@
|
||||||
(define input (open-input-text-editor this))
|
(define input (open-input-text-editor this))
|
||||||
(port-count-lines! input)
|
(port-count-lines! input)
|
||||||
(define log '())
|
(define log '())
|
||||||
|
(define unsaved-file?
|
||||||
|
(and (symbol? portname)
|
||||||
|
(regexp-match #rx"^unsaved-editor" (symbol->string portname))))
|
||||||
(define good-portname-cache #f)
|
(define good-portname-cache #f)
|
||||||
(define (right-file? f) ; does the log-entry refer to the file we're in?
|
(define (right-file? f) ; does the log-entry refer to the file we're in?
|
||||||
(cond [(and good-portname-cache ; cache is populated
|
(cond [(and good-portname-cache ; cache is populated
|
||||||
|
@ -42,6 +45,10 @@
|
||||||
[(send this port-name-matches? f)
|
[(send this port-name-matches? f)
|
||||||
(set! good-portname-cache f) ; populate cache
|
(set! good-portname-cache f) ; populate cache
|
||||||
#t]
|
#t]
|
||||||
|
[unsaved-file?
|
||||||
|
;; we assume that any log entry without a filename comes from
|
||||||
|
;; the unsaved editor
|
||||||
|
(not f)]
|
||||||
[else ; different file
|
[else ; different file
|
||||||
#f]))
|
#f]))
|
||||||
(with-intercepted-tr-logging
|
(with-intercepted-tr-logging
|
||||||
|
|
Loading…
Reference in New Issue
Block a user