]> git.eshelyaron.com Git - emacs.git/commitdiff
(redisplay): In previous change, handle case where no newline follows.
authorRichard M. Stallman <rms@gnu.org>
Fri, 1 Apr 1994 08:19:19 +0000 (08:19 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 1 Apr 1994 08:19:19 +0000 (08:19 +0000)
src/xdisp.c

index c537281fc1727d4770c65e5c5674dca8c099bebc..cc3df113278882ee1439e8f7effe9029cfb0842e 100644 (file)
@@ -626,8 +626,18 @@ redisplay ()
              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);