From 30ab843e52428456c7be6364b8dec45e1e58c160 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 12 Jul 1999 23:30:12 +0000 Subject: [PATCH] .. original commit: 7a7dd101a9f693a2592b71a66f99680308db2fb7 --- collects/framework/keymap.ss | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/collects/framework/keymap.ss b/collects/framework/keymap.ss index a45f6562..29c9ac56 100644 --- a/collects/framework/keymap.ss +++ b/collects/framework/keymap.ss @@ -37,12 +37,13 @@ [bb (box 0)]) (send edit get-visible-line-range bt bb) (let* ([half (sub1 (quotient (- (unbox bb) (unbox bt)) 2))] + [last-pos (send edit position-line (send edit last-position))] [top-pos (send edit line-start-position - (max (- new-mid-line half) 0))] + (max (min (- new-mid-line half) last-pos) 0))] [bottom-pos (send edit line-start-position - (min (+ new-mid-line half) - (send edit position-line - (send edit last-position))))]) + (max 0 + (min (+ new-mid-line half) + last-pos)))]) (send edit scroll-to-position top-pos #f