diff options
| author | Kenichi Handa | 1998-03-25 10:45:59 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-03-25 10:45:59 +0000 |
| commit | 4116deeea850a713bf63abcb90439bacbd5453a2 (patch) | |
| tree | f8e3cb92c324aa9ee6eaec0132643aa621476c4e /src | |
| parent | b745ec7ddec7bfb6af78e6d215f06402e91d5d85 (diff) | |
| download | emacs-4116deeea850a713bf63abcb90439bacbd5453a2.tar.gz emacs-4116deeea850a713bf63abcb90439bacbd5453a2.zip | |
(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')
| -rw-r--r-- | src/indent.c | 6 |
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, | |||
| 1104 | { | 1104 | { |
| 1105 | unsigned char *ovstr; | 1105 | unsigned char *ovstr; |
| 1106 | int ovlen = overlay_strings (pos, win, &ovstr); | 1106 | int ovlen = overlay_strings (pos, win, &ovstr); |
| 1107 | hpos += (multibyte ? strwidth (ovstr, ovlen) : ovlen); | 1107 | hpos += ((multibyte && ovlen > 0) |
| 1108 | ? strwidth (ovstr, ovlen) : ovlen); | ||
| 1108 | } | 1109 | } |
| 1109 | did_motion = 0; | 1110 | did_motion = 0; |
| 1110 | 1111 | ||
| @@ -1450,7 +1451,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 1450 | ptr = BYTE_POS_ADDR (pos_byte); | 1451 | ptr = BYTE_POS_ADDR (pos_byte); |
| 1451 | MULTIBYTE_BYTES_WIDTH (ptr, c, dp); | 1452 | MULTIBYTE_BYTES_WIDTH (ptr, c, dp); |
| 1452 | pos_byte += bytes; | 1453 | pos_byte += bytes; |
| 1453 | wide_column_end_hpos = hpos + wide_column; | 1454 | if (wide_column) |
| 1455 | wide_column_end_hpos = hpos + wide_column; | ||
| 1454 | hpos += width; | 1456 | hpos += width; |
| 1455 | } | 1457 | } |
| 1456 | else | 1458 | else |