From ffd57920a371da13e5e41f0df59ae5ed3446849c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 1 Apr 1994 08:19:19 +0000 Subject: [PATCH] (redisplay): In previous change, handle case where no newline follows. --- src/xdisp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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); -- 2.39.5