Index: pane.lisp
===================================================================
RCS file: /project/climacs/cvsroot/climacs/pane.lisp,v
retrieving revision 1.37
diff -u -r1.37 pane.lisp
--- pane.lisp	23 Apr 2006 19:37:58 -0000	1.37
+++ pane.lisp	4 May 2006 13:01:23 -0000
@@ -471,6 +471,16 @@
 ;;; cache at the end may be smaller than, equal to, or greater than
 ;;; the number of lines in the pane.
 (defun adjust-cache (pane)
+  (with-slots (top bot cache) pane
+    (beginning-of-line top)
+    (end-of-line bot)
+    (if (or (mark< (point pane) top)
+            (>= (number-of-lines-in-region top (point pane)) 
+                (nb-lines-in-pane pane))
+            (mark> (point pane) bot))
+        (reposition-window pane)
+        (empty-cache cache)))
+  #+nil
   (let* ((buffer (buffer pane))
 	 (high-mark (high-mark buffer))
 	 (low-mark (low-mark buffer))
