changeset 614:0085dcbad4bd

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Sat, 18 Apr 1992 16:01:05 +0000
parents 4de357ef5dba
children e2b34caa2da8
files src/indent.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/indent.c	Sat Apr 18 00:05:15 1992 +0000
+++ b/src/indent.c	Sat Apr 18 16:01:05 1992 +0000
@@ -461,7 +461,7 @@
 		{
 		  while (++pos < to && FETCH_CHAR (pos) != '\n');
 		}
-	      while (selective > 0 && position_indentation (pos + 1) >= selective);
+	      while (pos < to && position_indentation (pos + 1) >= selective);
 	      pos--;
 	      /* Allow for the " ..." that is displayed for them. */
 	      if (selective_rlen)
@@ -470,16 +470,17 @@
 		  if (hpos >= width)
 		    hpos = width;
 		}
+	      /* We have skipped the invis text, but not the newline after.  */
 	    }
 	  else
 	    {
 	      /* A visible line.  */
 	      vpos++;
 	      hpos = 0;
+	      hpos -= hscroll;
+	      if (hscroll > 0) hpos++; /* Count the ! on column 0 */
+	      tab_offset = 0;
 	    }
-	  hpos -= hscroll;
-	  if (hscroll > 0) hpos++; /* Count the ! on column 0 */
-	  tab_offset = 0;
 	}
       else if (c == CR && selective < 0)
 	{
@@ -518,6 +519,7 @@
 	      /* Truncating: skip to newline.  */
 	      while (pos < to && FETCH_CHAR (pos) != '\n') pos++;
 	      pos--;
+	      hpos = width;
 	    }
 	  else
 	    {