From a77dc1ecc3c03a316964177f488597e1c460999d Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Wed, 3 Jan 2001 19:19:39 +0000 Subject: [PATCH] (forward_to_next_line_start): Reset it->c if taking the short cut at the start of the function. Add an assertion. (reseat_at_next_visible_line_start): Add an assertion. --- src/ChangeLog | 4 ++++ src/xdisp.c | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b47b5c69512..d218f86eeb8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2001-01-03 Gerd Moellmann + * xdisp.c (forward_to_next_line_start): Reset it->c if taking the + short cut at the start of the function. Add an assertion. + (reseat_at_next_visible_line_start): Add an assertion. + * window.c (Frecenter): When changing the window start, set the window's window_end_valid to nil. (Fwindow_end): Fix window-end computation when UPDATE is non-nil. diff --git a/src/xdisp.c b/src/xdisp.c index 3e9790d1b8e..d4f25661e08 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3494,6 +3494,7 @@ forward_to_next_line_start (it, skipped_p) if (it->what == IT_CHARACTER && it->c == '\n') { set_iterator_to_next (it, 0); + it->c = 0; return 1; } @@ -3553,6 +3554,7 @@ forward_to_next_line_start (it, skipped_p) } it->selective = old_selective; + xassert (!newline_found_p || FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); return newline_found_p; } @@ -3642,9 +3644,12 @@ reseat_at_next_visible_line_start (it, on_newline_p) more than the value of IT->selective. */ if (it->selective > 0) while (IT_CHARPOS (*it) < ZV - && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), + && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), it->selective)) - newline_found_p = forward_to_next_line_start (it, &skipped_p); + { + xassert (FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); + newline_found_p = forward_to_next_line_start (it, &skipped_p); + } /* Position on the newline if that's what's requested. */ if (on_newline_p && newline_found_p) -- 2.39.5