summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1998-03-25 10:45:59 +0000
committerKenichi Handa <handa@m17n.org>1998-03-25 10:45:59 +0000
commit4116deeea850a713bf63abcb90439bacbd5453a2 (patch)
treef8e3cb92c324aa9ee6eaec0132643aa621476c4e /src/indent.c
parentb745ec7ddec7bfb6af78e6d215f06402e91d5d85 (diff)
downloademacs-4116deeea850a713bf63abcb90439bacbd5453a2.tar.gz
(compute_motion): Call strwidth only when necessary.
Set wide_column_end_hpos only when MULTIBYTE_BYTES_WIDTH set nonzero to wide_column.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/indent.c b/src/indent.c
index bd09008104c..2811fbde7b7 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1104,7 +1104,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
{
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 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
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