changeset 6622:1253ece9950b

(redisplay): In previous change, handle case where no newline follows.
author Richard M. Stallman <rms@gnu.org>
date Fri, 01 Apr 1994 08:19:19 +0000
parents 82404c81aac8
children 1d60a75efa87
files src/xdisp.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Fri Apr 01 02:31:45 1994 +0000
+++ b/src/xdisp.c	Fri Apr 01 08:19:19 1994 +0000
@@ -626,8 +626,18 @@
 	      int left = XFASTINT (w->left);
 	      int *charstart_next_line
 		= FRAME_CURRENT_GLYPHS (XFRAME (WINDOW_FRAME (w)))->charstarts[this_line_vpos + 1];
-	      int adjust = Z - tlendpos + 1 - charstart_next_line[left];
 	      int i;
+	      int adjust;
+
+	      if (Z - tlendpos == ZV)
+		/* This line ends at end of (accessible part of) buffer.
+		   There is no newline to count.  */
+		adjust = Z - tlendpos - charstart_next_line[left];
+	      else
+		/* This line ends in a newline.
+		   Must take account of the newline and the rest of the
+		   text that follows.  */
+		adjust = Z - tlendpos + 1 - charstart_next_line[left];
 
 	      adjust_window_charstarts (w, this_line_vpos, adjust);