summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-04-01 08:19:19 +0000
committerRichard M. Stallman <rms@gnu.org>1994-04-01 08:19:19 +0000
commite4d5ad1d90c9601115338369f0c3bcc572d58b6a (patch)
tree3162866caf66c8f1cfdfb07a2f9e75977b6247f8
parentb6f7e1ef7aeedf6aea759af9cd9b04dde3670352 (diff)
downloademacs-e4d5ad1d90c9601115338369f0c3bcc572d58b6a.tar.gz
(redisplay): In previous change, handle case where no newline follows.
-rw-r--r--src/xdisp.c12
1 files changed, 11 insertions, 1 deletions
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);