From: Richard M. Stallman Date: Fri, 1 Apr 1994 08:19:19 +0000 (+0000) Subject: (redisplay): In previous change, handle case where no newline follows. X-Git-Tag: emacs-19.34~9230 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ffd57920a371da13e5e41f0df59ae5ed3446849c;p=emacs.git (redisplay): In previous change, handle case where no newline follows. --- diff --git a/src/xdisp.c b/src/xdisp.c index c537281fc17..cc3df113278 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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);