diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 2f809e3a096..d4bdde452b5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -21367,25 +21367,33 @@ x_produce_glyphs (it) | |||
| 21367 | } | 21367 | } |
| 21368 | else if (it->char_to_display == '\t') | 21368 | else if (it->char_to_display == '\t') |
| 21369 | { | 21369 | { |
| 21370 | int tab_width = it->tab_width * font->space_width; | 21370 | if (font->space_width > 0) |
| 21371 | int x = it->current_x + it->continuation_lines_width; | 21371 | { |
| 21372 | int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width; | 21372 | int tab_width = it->tab_width * font->space_width; |
| 21373 | 21373 | int x = it->current_x + it->continuation_lines_width; | |
| 21374 | /* If the distance from the current position to the next tab | 21374 | int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width; |
| 21375 | stop is less than a space character width, use the | 21375 | |
| 21376 | tab stop after that. */ | 21376 | /* If the distance from the current position to the next tab |
| 21377 | if (next_tab_x - x < font->space_width) | 21377 | stop is less than a space character width, use the |
| 21378 | next_tab_x += tab_width; | 21378 | tab stop after that. */ |
| 21379 | 21379 | if (next_tab_x - x < font->space_width) | |
| 21380 | it->pixel_width = next_tab_x - x; | 21380 | next_tab_x += tab_width; |
| 21381 | it->nglyphs = 1; | 21381 | |
| 21382 | it->ascent = it->phys_ascent = FONT_BASE (font) + boff; | 21382 | it->pixel_width = next_tab_x - x; |
| 21383 | it->descent = it->phys_descent = FONT_DESCENT (font) - boff; | 21383 | it->nglyphs = 1; |
| 21384 | 21384 | it->ascent = it->phys_ascent = FONT_BASE (font) + boff; | |
| 21385 | if (it->glyph_row) | 21385 | it->descent = it->phys_descent = FONT_DESCENT (font) - boff; |
| 21386 | |||
| 21387 | if (it->glyph_row) | ||
| 21388 | { | ||
| 21389 | append_stretch_glyph (it, it->object, it->pixel_width, | ||
| 21390 | it->ascent + it->descent, it->ascent); | ||
| 21391 | } | ||
| 21392 | } | ||
| 21393 | else | ||
| 21386 | { | 21394 | { |
| 21387 | append_stretch_glyph (it, it->object, it->pixel_width, | 21395 | it->pixel_width = 0; |
| 21388 | it->ascent + it->descent, it->ascent); | 21396 | it->nglyphs = 1; |
| 21389 | } | 21397 | } |
| 21390 | } | 21398 | } |
| 21391 | else | 21399 | else |