fixed PR 8359
svn: r4749
This commit is contained in:
parent
9a5eced27b
commit
c577c8080c
|
@ -961,29 +961,32 @@ TODO
|
|||
|
||||
(define/augment (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 (if (preferences:get 'drscheme:execute-warning-once)
|
||||
(and (not already-warned?)
|
||||
needs-execution)
|
||||
needs-execution)
|
||||
(set! already-warned? #t)
|
||||
(insert-warning needs-execution)))
|
||||
(when (and (get-user-thread)
|
||||
(thread-running? (get-user-thread)))
|
||||
;; the -2 drops the last newline from history (why -2 and not -1?!)
|
||||
(save-interaction-in-history prompt-position (- (last-position) 2))
|
||||
(freeze-colorer)
|
||||
|
||||
;; lets us know we are done with this one interaction
|
||||
;; (since there may be multiple expressions at the prompt)
|
||||
(send-eof-to-in-port)
|
||||
(let ([needs-execution (send context needs-execution)])
|
||||
(when (if (preferences:get 'drscheme:execute-warning-once)
|
||||
(and (not already-warned?)
|
||||
needs-execution)
|
||||
needs-execution)
|
||||
(set! already-warned? #t)
|
||||
(insert-warning needs-execution)))
|
||||
|
||||
(set! prompt-position #f)
|
||||
(evaluate-from-port
|
||||
(get-in-port)
|
||||
#f
|
||||
(λ ()
|
||||
;; clear out the eof object if it wasn't consumed
|
||||
(clear-input-port))))
|
||||
;; lets us know we are done with this one interaction
|
||||
;; (since there may be multiple expressions at the prompt)
|
||||
(send-eof-to-in-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)
|
||||
;; the position just after the last prompt
|
||||
|
|
Loading…
Reference in New Issue
Block a user