changeset 35029:e02de3bdd349

(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.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 03 Jan 2001 19:19:01 +0000
parents d95d24e2e8a3
children fb57c3f4a4e0
files src/xdisp.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Wed Jan 03 16:30:36 2001 +0000
+++ b/src/xdisp.c	Wed Jan 03 19:19:01 2001 +0000
@@ -3494,6 +3494,7 @@
   if (it->what == IT_CHARACTER && it->c == '\n')
     {
       set_iterator_to_next (it, 0);
+      it->c = 0;
       return 1;
     }
 
@@ -3553,6 +3554,7 @@
     }
 
   it->selective = old_selective;
+  xassert (!newline_found_p || FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n');
   return newline_found_p;
 }
 
@@ -3642,9 +3644,12 @@
      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)