changeset 19208:1d24f0a03f75

(current_column): Update ptr differently at newline so that current_column_bol_cache is set properly.
author Richard M. Stallman <rms@gnu.org>
date Thu, 07 Aug 1997 09:01:52 +0000
parents be370e94fb42
children 50857b41060a
files src/indent.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/indent.c	Thu Aug 07 08:59:08 1997 +0000
+++ b/src/indent.c	Thu Aug 07 09:01:52 1997 +0000
@@ -349,10 +349,12 @@
 	col += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;
       else if (c >= 040 && c < 0177)
 	col++;
-      else if (c == '\n')
-	break;
-      else if (c == '\r' && EQ (current_buffer->selective_display, Qt))
-	break;
+      else if (c == '\n'
+	       || (c == '\r' && EQ (current_buffer->selective_display, Qt)))
+	{
+	  ptr++;
+	  break;
+	}
       else if (c == '\t')
 	{
 	  if (tab_seen)
@@ -375,7 +377,7 @@
   if (ptr == BEGV_ADDR)
     current_column_bol_cache = BEGV;
   else
-    current_column_bol_cache = PTR_CHAR_POS ((ptr+1));
+    current_column_bol_cache = PTR_CHAR_POS (ptr);
   last_known_column = col;
   last_known_column_point = PT;
   last_known_column_modified = MODIFF;