aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
authorPo Lu2024-02-01 16:16:09 +0800
committerPo Lu2024-02-01 16:16:09 +0800
commit881a1ade30d2efacf9fcbd136b8fea722760f36e (patch)
tree3f00756ea293c9c25186c716b0e5cc205894af93 /src/term.c
parentb86bc02096c65517b9a29c20635ece100864fc62 (diff)
downloademacs-881a1ade30d2efacf9fcbd136b8fea722760f36e.tar.gz
emacs-881a1ade30d2efacf9fcbd136b8fea722760f36e.zip
Prevent continuation from affecting tab width in/after line prefix
* src/dispextern.h (struct it) <wrap_prefix_width>: New field, synchronized with current_x when producing glyphs for wrap prefixes, and subtracted from it->current_x when computing tab widths. * src/term.c (produce_glyphs): Set wrap_prefix_width. * src/xdisp.c (start_display, display_min_width, move_it_to) (move_it_vertically_backward, move_it_by_lines) (window_text_pixel_size, display_tab_bar_line) (display_tool_bar_line, redisplay_internal, redisplay_window) (try_window_id, insert_left_trunc_glyphs) (extend_face_to_end_of_line, display_line) (Fmove_point_visually): Set or clear wrap_prefix_width as appropriate. (gui_produce_glyphs): Set or clear it->wrap_prefix_width. When computing the base position of a tab character, do not subtract the continuation line width if a line prefix is the current iterator method. Subtract the wrap_prefix_width otherwise, in order that the width of the tab is computed free of influence from the wrap prefix.
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/term.c b/src/term.c
index 447876d288a..b3793088fac 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1704,7 +1704,13 @@ produce_glyphs (struct it *it)
1704 /* Advance current_x by the pixel width as a convenience for 1704 /* Advance current_x by the pixel width as a convenience for
1705 the caller. */ 1705 the caller. */
1706 if (it->area == TEXT_AREA) 1706 if (it->area == TEXT_AREA)
1707 it->current_x += it->pixel_width; 1707 {
1708 it->current_x += it->pixel_width;
1709
1710 if (it->continuation_lines_width
1711 && it->string_from_prefix_prop_p)
1712 it->wrap_prefix_width = it->current_x;
1713 }
1708 it->ascent = it->max_ascent = it->phys_ascent = it->max_phys_ascent = 0; 1714 it->ascent = it->max_ascent = it->phys_ascent = it->max_phys_ascent = 0;
1709 it->descent = it->max_descent = it->phys_descent = it->max_phys_descent = 1; 1715 it->descent = it->max_descent = it->phys_descent = it->max_phys_descent = 1;
1710#endif 1716#endif