diff options
| author | Eli Zaretskii | 2017-06-29 21:09:55 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-06-29 21:09:55 +0300 |
| commit | 5b9b49492b9c024bd07b83ef6e5d095af6b8fdd0 (patch) | |
| tree | 85029089feee588901bcc21e348dd5108fb5c838 | |
| parent | 71e31ac839b05d01486d728d4da9a8daaf1ae240 (diff) | |
| download | emacs-5b9b49492b9c024bd07b83ef6e5d095af6b8fdd0.tar.gz emacs-5b9b49492b9c024bd07b83ef6e5d095af6b8fdd0.zip | |
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.
| -rw-r--r-- | src/xdisp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index ef2e2646b2c..bbf30504844 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -20916,7 +20916,7 @@ maybe_produce_line_number (struct it *it) | |||
| 20916 | tem_it.face_id = lnum_face_id; | 20916 | tem_it.face_id = lnum_face_id; |
| 20917 | if (beyond_zv | 20917 | if (beyond_zv |
| 20918 | /* Don't display the same line number more than once. */ | 20918 | /* Don't display the same line number more than once. */ |
| 20919 | && (!EQ (Vdisplay_line_numbers, Qvisual) | 20919 | || (!EQ (Vdisplay_line_numbers, Qvisual) |
| 20920 | && (it->continuation_lines_width > 0 | 20920 | && (it->continuation_lines_width > 0 |
| 20921 | || (this_line == last_line && !first_time)))) | 20921 | || (this_line == last_line && !first_time)))) |
| 20922 | tem_it.c = tem_it.char_to_display = ' '; | 20922 | tem_it.c = tem_it.char_to_display = ' '; |
| @@ -27996,19 +27996,22 @@ x_produce_glyphs (struct it *it) | |||
| 27996 | { | 27996 | { |
| 27997 | int tab_width = it->tab_width * font->space_width; | 27997 | int tab_width = it->tab_width * font->space_width; |
| 27998 | int x = it->current_x + it->continuation_lines_width; | 27998 | int x = it->current_x + it->continuation_lines_width; |
| 27999 | int x0 = x; | ||
| 27999 | /* Adjust for line numbers. Kludge alert: the "2" below | 28000 | /* Adjust for line numbers. Kludge alert: the "2" below |
| 28000 | is because we add 2 blanks to the actual line number. */ | 28001 | is because we add 2 blanks to the actual line number. */ |
| 28001 | if (!NILP (Vdisplay_line_numbers)) | 28002 | if (!NILP (Vdisplay_line_numbers)) |
| 28002 | x -= (it->lnum_width + 2 - it->w->hscroll) * font->space_width; | 28003 | x -= (it->lnum_width + 2) * font->space_width; |
| 28003 | int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width; | 28004 | int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width; |
| 28005 | if (!NILP (Vdisplay_line_numbers)) | ||
| 28006 | next_tab_x += (it->lnum_width + 2) * font->space_width; | ||
| 28004 | 28007 | ||
| 28005 | /* If the distance from the current position to the next tab | 28008 | /* If the distance from the current position to the next tab |
| 28006 | stop is less than a space character width, use the | 28009 | stop is less than a space character width, use the |
| 28007 | tab stop after that. */ | 28010 | tab stop after that. */ |
| 28008 | if (next_tab_x - x < font->space_width) | 28011 | if (next_tab_x - x0 < font->space_width) |
| 28009 | next_tab_x += tab_width; | 28012 | next_tab_x += tab_width; |
| 28010 | 28013 | ||
| 28011 | it->pixel_width = next_tab_x - x; | 28014 | it->pixel_width = next_tab_x - x0; |
| 28012 | it->nglyphs = 1; | 28015 | it->nglyphs = 1; |
| 28013 | if (FONT_TOO_HIGH (font)) | 28016 | if (FONT_TOO_HIGH (font)) |
| 28014 | { | 28017 | { |