diff src/indent.c @ 361:7347b34c275b r21-1-10

Import from CVS: tag r21-1-10
author cvs
date Mon, 13 Aug 2007 10:58:40 +0200
parents 7c94d56991e1
children cc15677e0335
line wrap: on
line diff
--- a/src/indent.c	Mon Aug 13 10:57:57 2007 +0200
+++ b/src/indent.c	Mon Aug 13 10:58:40 2007 +0200
@@ -573,8 +573,15 @@
   /* #### This assertion must be true before the if statements are hit
      but may possibly be wrong after the call to
      point_in_line_start_cache if orig is outside of the visible
-     region of the buffer.  Handle this. */
-  assert (elt >= 0);
+     region of the buffer.  Handle this.
+
+     This occurs sometimes if scroll-step is non-zero and the window
+     is very small.  In this case it's not possible to lay out any lines
+     in the window and point_in_line_start_cache returns -1 because
+     the line cache is empty.  In this case we will just return the
+     original point and hope for the best. */
+  if (elt < 0)
+    return orig;
 
   /* Moving downward. */
   if (vtarget > 0)