diff src/redisplay.c @ 10:49a24b4fd526 r19-15b6

Import from CVS: tag r19-15b6
author cvs
date Mon, 13 Aug 2007 08:47:52 +0200
parents b82b59fe008d
children 0293115a14e9
line wrap: on
line diff
--- a/src/redisplay.c	Mon Aug 13 08:47:36 2007 +0200
+++ b/src/redisplay.c	Mon Aug 13 08:47:52 2007 +0200
@@ -5786,6 +5786,7 @@
 #else /* not MSDOS */
       str = "T";
 #endif /* not MSDOS */
+      break;
 
       /* print percent of buffer above top of window, or Top, Bot or All */
     case 'p':
@@ -5833,6 +5834,12 @@
       Bufpos botpos = BUF_Z (b) - w->window_end_pos[type];
       Charcount total = BUF_ZV (b) - BUF_BEGV (b);
 
+      /* botpos is only accurate as of the last redisplay, so we can
+	 only treat it as a hint.  In particular, after erase-buffer,
+	 botpos may be negative. */
+      if (botpos < toppos)
+	botpos = toppos;
+
       if (botpos >= BUF_ZV (b))
 	{
 	  if (toppos <= BUF_BEGV (b))