diff options
| author | Eli Zaretskii | 2017-06-25 20:53:05 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-06-25 20:53:05 +0300 |
| commit | 5d1025e7162db46b3c8d7c19facd8f9b9eff6f49 (patch) | |
| tree | 24040876a17ba2296b57b318e239c5436b273d1f /src/xdisp.c | |
| parent | 540669cda984f64964d7baeb7369d3eea424a34c (diff) | |
| download | emacs-5d1025e7162db46b3c8d7c19facd8f9b9eff6f49.tar.gz emacs-5d1025e7162db46b3c8d7c19facd8f9b9eff6f49.zip | |
Allow to disable display of line numbers beyond EOB
* src/buffer.c (disable_line_numbers_overlay_at_eob): New
function.
* src/lisp.h (disable_line_numbers_overlay_at_eob): Add prototype.
* src/xdisp.c (should_produce_line_number): When at ZV, call
disable_line_numbers_overlay_at_eob to determine whether line
numbers should be displayed beyond ZV.
Diffstat (limited to 'src/xdisp.c')
| -rw-r--r-- | src/xdisp.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index c318a6954c4..7649b16e974 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -20948,10 +20948,15 @@ should_produce_line_number (struct it *it) | |||
| 20948 | #endif | 20948 | #endif |
| 20949 | 20949 | ||
| 20950 | /* If the character at current position has a non-nil special | 20950 | /* If the character at current position has a non-nil special |
| 20951 | property, disable line numbers for this row. */ | 20951 | property, disable line numbers for this row. For ZV, we need to |
| 20952 | Lisp_Object val = Fget_char_property (make_number (IT_CHARPOS (*it)), | 20952 | use a special algorithm that only supports empty overlays at that |
| 20953 | Qdisplay_line_numbers_disable, | 20953 | point, because get-char-property always returns nil for ZV. */ |
| 20954 | it->window); | 20954 | Lisp_Object val = Qnil; |
| 20955 | if (IT_CHARPOS (*it) >= ZV) | ||
| 20956 | val = disable_line_numbers_overlay_at_eob (); | ||
| 20957 | else | ||
| 20958 | val = Fget_char_property (make_number (IT_CHARPOS (*it)), | ||
| 20959 | Qdisplay_line_numbers_disable, it->window); | ||
| 20955 | return NILP (val) ? true : false; | 20960 | return NILP (val) ? true : false; |
| 20956 | } | 20961 | } |
| 20957 | 20962 | ||