fixed PR 8359

svn: r4749
This commit is contained in:
Robby Findler 2006-11-02 04:30:56 +00:00
parent 9a5eced27b
commit c577c8080c

View File

@ -961,29 +961,32 @@ TODO
(define/augment (on-submit) (define/augment (on-submit)
(inner (void) on-submit) (inner (void) on-submit)
;; the -2 drops the last newline from history (why -2 and not -1?!)
(save-interaction-in-history prompt-position (- (last-position) 2))
(freeze-colorer)
(let ([needs-execution (send context needs-execution)]) (when (and (get-user-thread)
(when (if (preferences:get 'drscheme:execute-warning-once) (thread-running? (get-user-thread)))
(and (not already-warned?) ;; the -2 drops the last newline from history (why -2 and not -1?!)
needs-execution) (save-interaction-in-history prompt-position (- (last-position) 2))
needs-execution) (freeze-colorer)
(set! already-warned? #t)
(insert-warning needs-execution))) (let ([needs-execution (send context needs-execution)])
(when (if (preferences:get 'drscheme:execute-warning-once)
;; lets us know we are done with this one interaction (and (not already-warned?)
;; (since there may be multiple expressions at the prompt) needs-execution)
(send-eof-to-in-port) needs-execution)
(set! already-warned? #t)
(set! prompt-position #f) (insert-warning needs-execution)))
(evaluate-from-port
(get-in-port) ;; lets us know we are done with this one interaction
#f ;; (since there may be multiple expressions at the prompt)
(λ () (send-eof-to-in-port)
;; clear out the eof object if it wasn't consumed
(clear-input-port)))) (set! prompt-position #f)
(evaluate-from-port
(get-in-port)
#f
(λ ()
;; clear out the eof object if it wasn't consumed
(clear-input-port)))))
;; prompt-position : (union #f integer) ;; prompt-position : (union #f integer)
;; the position just after the last prompt ;; the position just after the last prompt