From 1bda466f2193841bdf4fc2b3f866a8a5985e03b4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 18 Aug 1993 23:57:38 +0000 Subject: [PATCH] Fix instance of "point not visible at end of redisplay" error that Matt Birkholz pointed out. Change code that generates this error to conditionally force the point to be visible; this results in more robust behavior. --- v7/src/edwin/bufwin.scm | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/v7/src/edwin/bufwin.scm b/v7/src/edwin/bufwin.scm index 889f7d403..a6849e78d 100644 --- a/v7/src/edwin/bufwin.scm +++ b/v7/src/edwin/bufwin.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: bufwin.scm,v 1.300 1993/01/16 05:15:30 cph Exp $ +;;; $Id: bufwin.scm,v 1.301 1993/08/18 23:57:38 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology ;;; @@ -966,7 +966,8 @@ This number is a percentage, where 0 is the window's top and 100 the bottom." (let ((mask (set-interrupt-enables! interrupt-mask/gc-ok))) (%set-window-point-index! window - (or (predict-index window start y-start 0 point-y) + (or (predict-index window start y-start + (vector-ref cws 4) point-y) (%window-group-end-index window))) (set-window-start! window cws) (set-interrupt-enables! mask) @@ -1198,9 +1199,23 @@ If this is zero, point is always centered after it moves off screen." (define (update-cursor! window) (let ((xy (buffer-window/point-coordinates window))) - (if (not (and (fix:<= 0 (car xy)) - (fix:< (car xy) (window-x-size window)) - (fix:<= 0 (cdr xy)) - (fix:< (cdr xy) (window-y-size window)))) - (error "point not visible at end of redisplay")) - (set-inferior-position! (%window-cursor-inferior window) xy))) \ No newline at end of file + (if (and (fix:<= 0 (car xy)) + (fix:< (car xy) (window-x-size window)) + (fix:<= 0 (cdr xy)) + (fix:< (cdr xy) (window-y-size window))) + (set-inferior-position! (%window-cursor-inferior window) xy) + (begin + (if point-not-visible-error? + (error "point not visible at end of redisplay")) + (%set-window-point-index! + window + (or (predict-index window + (%window-start-line-index window) + (%window-start-line-y window) + (%window-start-partial window) + 0) + (%window-group-end-index window))) + (update-cursor! window))))) + +(define point-not-visible-error? + #f) \ No newline at end of file -- 2.25.1