changeset 21283:c431691cbff1

(compute_motion): Call strwidth only when necessary. Set wide_column_end_hpos only when MULTIBYTE_BYTES_WIDTH set nonzero to wide_column.
author Kenichi Handa <handa@m17n.org>
date Wed, 25 Mar 1998 10:45:59 +0000
parents 58268912c0b5
children 1d971e4f4645
files src/indent.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/indent.c	Wed Mar 25 10:45:59 1998 +0000
+++ b/src/indent.c	Wed Mar 25 10:45:59 1998 +0000
@@ -1104,7 +1104,8 @@
 	    {
 	      unsigned char *ovstr;
 	      int ovlen = overlay_strings (pos, win, &ovstr);
-	      hpos += (multibyte ? strwidth (ovstr, ovlen) : ovlen);
+	      hpos += ((multibyte && ovlen > 0)
+		       ? strwidth (ovstr, ovlen) : ovlen);
 	    }
 	  did_motion = 0;
 
@@ -1450,7 +1451,8 @@
 	      ptr = BYTE_POS_ADDR (pos_byte);
 	      MULTIBYTE_BYTES_WIDTH (ptr, c, dp);
 	      pos_byte += bytes;
-	      wide_column_end_hpos = hpos + wide_column;
+	      if (wide_column)
+		wide_column_end_hpos = hpos + wide_column;
 	      hpos += width;
 	    }
 	  else