# HG changeset patch # User Richard M. Stallman # Date 765188359 0 # Node ID 1253ece9950bb5538d2fa4c46e6ffea062950687 # Parent 82404c81aac8e2178d5fd6b91c6bdcce7c26dd84 (redisplay): In previous change, handle case where no newline follows. diff -r 82404c81aac8 -r 1253ece9950b src/xdisp.c --- 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);