diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/indent.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/indent.c b/src/indent.c index ded18439fd9..584f2179bc5 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -485,7 +485,9 @@ check_display_width (ptrdiff_t pos, ptrdiff_t col, ptrdiff_t *endpos) | |||
| 485 | : MOST_POSITIVE_FIXNUM); | 485 | : MOST_POSITIVE_FIXNUM); |
| 486 | 486 | ||
| 487 | if ((prop = Fplist_get (plist, QCwidth), | 487 | if ((prop = Fplist_get (plist, QCwidth), |
| 488 | RANGED_INTEGERP (0, prop, INT_MAX))) | 488 | RANGED_INTEGERP (0, prop, INT_MAX)) |
| 489 | || (prop = Fplist_get (plist, QCrelative_width), | ||
| 490 | RANGED_INTEGERP (0, prop, INT_MAX))) | ||
| 489 | width = XINT (prop); | 491 | width = XINT (prop); |
| 490 | else if (FLOATP (prop) && 0 <= XFLOAT_DATA (prop) | 492 | else if (FLOATP (prop) && 0 <= XFLOAT_DATA (prop) |
| 491 | && XFLOAT_DATA (prop) <= INT_MAX) | 493 | && XFLOAT_DATA (prop) <= INT_MAX) |
| @@ -504,6 +506,18 @@ check_display_width (ptrdiff_t pos, ptrdiff_t col, ptrdiff_t *endpos) | |||
| 504 | *endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 506 | *endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); |
| 505 | else | 507 | else |
| 506 | get_property_and_range (pos, Qdisplay, &val, &start, endpos, Qnil); | 508 | get_property_and_range (pos, Qdisplay, &val, &start, endpos, Qnil); |
| 509 | |||
| 510 | /* For :relative-width, we need to multiply by the column | ||
| 511 | width of the character at POS, if it is greater than 1. */ | ||
| 512 | if (!NILP (Fplist_get (plist, QCrelative_width)) | ||
| 513 | && !NILP (BVAR (current_buffer, enable_multibyte_characters))) | ||
| 514 | { | ||
| 515 | int b, wd; | ||
| 516 | unsigned char *p = BYTE_POS_ADDR (CHAR_TO_BYTE (pos)); | ||
| 517 | |||
| 518 | MULTIBYTE_BYTES_WIDTH (p, buffer_display_table (), b, wd); | ||
| 519 | width *= wd; | ||
| 520 | } | ||
| 507 | return width; | 521 | return width; |
| 508 | } | 522 | } |
| 509 | } | 523 | } |