diff options
author | Eli Zaretskii <eliz@gnu.org> | 2018-03-07 20:40:44 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2018-03-07 20:40:44 +0200 |
commit | 1ac190553886ff20817d3dd218464e2fc6f9e42a (patch) | |
tree | ce84ae0c548359086f5762d150eaa9673c7fe2ba /src/term.c | |
parent | 4ad214f36c2b1eab4446f9f698ce2588941a7356 (diff) | |
download | emacs-1ac190553886ff20817d3dd218464e2fc6f9e42a.tar.gz |
Fix display of TABs in hscrolled windows with line numbers
* src/dispextern.h (struct it): New members tab_offset and
line_number_produced_p.
* src/xdisp.c (display_line): Don't set row->x to a negative value
if line numbers are being displayed. (Bug#30582)
Reset the line_number_produced_p flag before laying out the glyph
row.
(x_produce_glyphs): Use the line_number_produced_p flag to decide
whether to offset the X coordinate due to line-number display.
Use the tab_offset member to restore the original TAB width for
alignment purposes.
(move_it_in_display_line_to): Don't produce line numbers when moving
in hscrolled window to the left of first_visible_x.
(maybe_produce_line_number): Set the line_number_produced_p flag.
(Bug#30584)
* src/term.c (produce_glyphs): Correct TAB width only when
line_number_produced_p flag is set.
Diffstat (limited to 'src/term.c')
-rw-r--r-- | src/term.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/term.c b/src/term.c index 64a2b7e5519..8be5fb319b0 100644 --- a/src/term.c +++ b/src/term.c @@ -1591,13 +1591,13 @@ produce_glyphs (struct it *it) + it->continuation_lines_width); int x0 = absolute_x; /* Adjust for line numbers. */ - if (!NILP (Vdisplay_line_numbers)) + if (!NILP (Vdisplay_line_numbers) && it->line_number_produced_p) absolute_x -= it->lnum_pixel_width; int next_tab_x = (((1 + absolute_x + it->tab_width - 1) / it->tab_width) * it->tab_width); - if (!NILP (Vdisplay_line_numbers)) + if (!NILP (Vdisplay_line_numbers) && it->line_number_produced_p) next_tab_x += it->lnum_pixel_width; int nspaces; |