Add check to WINDOW-MARK-VISIBLE? to handle marks that fall outside
authorChris Hanson <org/chris-hanson/cph>
Fri, 17 May 1991 19:11:32 +0000 (19:11 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 17 May 1991 19:11:32 +0000 (19:11 +0000)
the display clipping limits.

v7/src/edwin/bufwmc.scm

index 646a71d1f58341f957bd4f2dc3c47582972b2db4..3c5ca8da3b1f6e032309d6bc12e7d3bd719139db 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufwmc.scm,v 1.13 1991/04/02 19:55:33 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufwmc.scm,v 1.14 1991/05/17 19:11:32 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 (define (buffer-window/mark-visible? window mark)
   ;; True iff cursor at this position would be on-screen.
   (let ((index (mark-index mark)))
-    (with-values (lambda () (start-point-for-index window index))
-      (lambda (start-index start-y line-start-index)
-       line-start-index
-       (predict-index-visible? window start-index start-y index)))))
+    (and (fix:<= (%window-group-start-index window) index)
+        (fix:<= index (%window-group-end-index window))
+        (with-values (lambda () (start-point-for-index window index))
+          (lambda (start-index start-y line-start-index)
+            line-start-index
+            (predict-index-visible? window start-index start-y index))))))
 \f
 (define (start-point-for-index window index)
   (if (outlines-valid? window)