[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/line-numbers 5b9b494 4/9: Minor fixes
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] scratch/line-numbers 5b9b494 4/9: Minor fixes |
Date: |
Fri, 30 Jun 2017 10:41:20 -0400 (EDT) |
branch: scratch/line-numbers
commit 5b9b49492b9c024bd07b83ef6e5d095af6b8fdd0
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Minor fixes
* src/xdisp.c (maybe_produce_line_number): Fix bug that caused
line numbers to be displayed in empty lines beyond ZV.
(x_produce_glyphs): Start fixing TAB display in truncated lines.
---
src/xdisp.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index ef2e264..bbf3050 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20916,7 +20916,7 @@ maybe_produce_line_number (struct it *it)
tem_it.face_id = lnum_face_id;
if (beyond_zv
/* Don't display the same line number more than once. */
- && (!EQ (Vdisplay_line_numbers, Qvisual)
+ || (!EQ (Vdisplay_line_numbers, Qvisual)
&& (it->continuation_lines_width > 0
|| (this_line == last_line && !first_time))))
tem_it.c = tem_it.char_to_display = ' ';
@@ -27996,19 +27996,22 @@ x_produce_glyphs (struct it *it)
{
int tab_width = it->tab_width * font->space_width;
int x = it->current_x + it->continuation_lines_width;
+ int x0 = x;
/* 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 - it->w->hscroll) * font->space_width;
+ x -= (it->lnum_width + 2) * font->space_width;
int next_tab_x = ((1 + x + tab_width - 1) / tab_width) *
tab_width;
+ if (!NILP (Vdisplay_line_numbers))
+ next_tab_x += (it->lnum_width + 2) * font->space_width;
/* If the distance from the current position to the next tab
stop is less than a space character width, use the
tab stop after that. */
- if (next_tab_x - x < font->space_width)
+ if (next_tab_x - x0 < font->space_width)
next_tab_x += tab_width;
- it->pixel_width = next_tab_x - x;
+ it->pixel_width = next_tab_x - x0;
it->nglyphs = 1;
if (FONT_TOO_HIGH (font))
{
- [Emacs-diffs] scratch/line-numbers updated (33073d5 -> e83b128), Eli Zaretskii, 2017/06/30
- [Emacs-diffs] scratch/line-numbers 5b9b494 4/9: Minor fixes,
Eli Zaretskii <=
- [Emacs-diffs] scratch/line-numbers dfe1c82 5/9: Fix TAB display when the line-number face uses a smaller/larger font, Eli Zaretskii, 2017/06/30
- [Emacs-diffs] scratch/line-numbers a06dd3b 6/9: Fix hscrolling with line numbers on TTY frames, Eli Zaretskii, 2017/06/30
- [Emacs-diffs] scratch/line-numbers beb95a8 2/9: Initial support for visually-relative line numbers, Eli Zaretskii, 2017/06/30
- [Emacs-diffs] scratch/line-numbers 67c8a21 1/9: Update IT's metrics while simulating display, Eli Zaretskii, 2017/06/30
- [Emacs-diffs] scratch/line-numbers 71e31ac 3/9: Support default-text-properties, Eli Zaretskii, 2017/06/30
- [Emacs-diffs] scratch/line-numbers 0e4f2e0 7/9: Speed up the visual-mode relative line numbers, Eli Zaretskii, 2017/06/30
- [Emacs-diffs] scratch/line-numbers 7a762fb 8/9: Support displaying zero as the number of the current line, Eli Zaretskii, 2017/06/30
- [Emacs-diffs] scratch/line-numbers e83b128 9/9: Add documentation for display-line-numbers, Eli Zaretskii, 2017/06/30