From 4db7477b0da5aa6ceca593b53de57caaf4793dd2 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 20 May 2014 17:17:12 -0500 Subject: [PATCH] fix timeout computation in the REPL io In the case that the flush queue was empty, the first byte that comes it would appear to have come from a long time ago and thus get flushed immediately. Instead, when the first byte comes in, we restart the timer at that point, intead of holding the old value --- pkgs/gui-pkgs/gui-lib/framework/private/text.rkt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/gui-pkgs/gui-lib/framework/private/text.rkt b/pkgs/gui-pkgs/gui-lib/framework/private/text.rkt index 28b8824472..dffa3f7da1 100644 --- a/pkgs/gui-pkgs/gui-lib/framework/private/text.rkt +++ b/pkgs/gui-pkgs/gui-lib/framework/private/text.rkt @@ -2641,7 +2641,10 @@ [((at-queue-size text-to-insert) . < . output-buffer-full) (when return-chan (channel-put return-chan '())) - (loop new-text-to-insert last-flush)] + (loop new-text-to-insert + (if (at-queue-empty? text-to-insert) + (current-inexact-milliseconds) + last-flush))] [else (let ([chan (make-channel)]) (let-values ([(viable-bytes remaining-queue)