]> git.eshelyaron.com Git - emacs.git/commit
Prevent continuation from affecting tab width in/after line prefix
authorPo Lu <luangruo@yahoo.com>
Thu, 1 Feb 2024 08:16:09 +0000 (16:16 +0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 2 Feb 2024 18:05:21 +0000 (19:05 +0100)
commit7aa46f52d6f508076907e45213f8284f72d01856
tree304cbaee95ca4c9a57658b22e203c2b0a9221f5d
parentb69da385b3e106e4cfe9fad3bdc7f50a58980d05
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.

(cherry picked from commit 881a1ade30d2efacf9fcbd136b8fea722760f36e)
src/dispextern.h
src/term.c
src/xdisp.c