"Clever" fix to handle case of deletion to window start causes "point
authorChris Hanson <org/chris-hanson/cph>
Thu, 23 Sep 1993 07:06:56 +0000 (07:06 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 23 Sep 1993 07:06:56 +0000 (07:06 +0000)
not visible at end of redisplay" error.  This happens when the start
mark is clobbered and the new start is not near enough to the point;
for example by deleting some text, then replacing it with itself.

Also, somehow UPDATE-OUTLINES! is getting called with FORCE-REDRAW?
and the CURRENT-START-MARK both false, which shouldn't be able to
happen; compiled code deals with this by treating #f as 0.  This
change fixes this unusual case.

v7/src/edwin/bufwiu.scm

index d6513567d6939082656f96b0b0b4f46bbf1e477d..8b19f2f95fdf30959e515c1f3b766768b069411f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: bufwiu.scm,v 1.24 1993/01/29 23:05:40 cph Exp $
+;;;    $Id: bufwiu.scm,v 1.25 1993/09/23 07:06:56 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology
 ;;;
              (begin
                ;; If this change affects START-MARK, invalidate it
                ;; and request a display update.
-               (if (let ((wlstart (%window-start-line-index window))
-                         (wstart (%window-start-index window)))
-                     (and (if (fix:= wlstart wstart)
-                              (fix:< start wstart)
-                              (fix:<= start wstart))
-                          (fix:<= wlstart end)))
+               (if (and (fix:<= start (%window-start-index window))
+                        (fix:<= (%window-start-line-index window) end))
                    (begin
                      (clear-window-start! window)
                      (window-needs-redisplay! window)))
        (preserve-nothing! window))
       (let ((start (%window-current-start-index window))
            (end (%window-current-end-index window)))
-       (cond ((and (%window-start-clip-mark window)
-                   (or (fix:< start (%window-group-start-index window))
-                       (fix:< (%window-group-start-index window)
-                              (%window-start-clip-index window))
-                       (fix:< (%window-group-end-index window) end)
-                       (fix:< (%window-end-clip-index window)
-                              (%window-group-end-index window))))
+       (cond ((or (not start)
+                  (and (%window-start-clip-mark window)
+                       (or (fix:< start (%window-group-start-index window))
+                           (fix:< (%window-group-start-index window)
+                                  (%window-start-clip-index window))
+                           (fix:< (%window-group-end-index window) end)
+                           (fix:< (%window-end-clip-index window)
+                                  (%window-group-end-index window)))))
               (preserve-nothing! window))
              ((and (fix:> (group-modified-tick (%window-group window))
                           (%window-modified-tick window))