Commit 55a9298d authored by Eli Zaretskii's avatar Eli Zaretskii

Fix tab stops when line numbers are displayed

* src/xdisp.c (x_produce_glyphs):
* src/term.c (produce_glyphs): Adjust tab stops for the horizontal
space taken by the line-number display.
parent 7d7602ce
......@@ -1584,6 +1584,10 @@ produce_glyphs (struct it *it)
{
int absolute_x = (it->current_x
+ it->continuation_lines_width);
/* Adjust for line numbers. Kludge alert: the "2" below is
because we add 2 blanks to the actual line number. */
if (!NILP (Vdisplay_line_numbers))
absolute_x -= it->lnum_width + 2;
int next_tab_x
= (((1 + absolute_x + it->tab_width - 1)
/ it->tab_width)
......
......@@ -27865,6 +27865,10 @@ x_produce_glyphs (struct it *it)
{
int tab_width = it->tab_width * font->space_width;
int x = it->current_x + it->continuation_lines_width;
/* Adjust for line numbers. Kludge alert: the "2" below
is because we add 2 blanks to the actual line number. */
if (!NILP (Vdisplay_line_numbers))
x -= (it->lnum_width + 2) * font->space_width;
int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width;
/* If the distance from the current position to the next tab
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment