[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Line height issues with display-line-number-mode

From: Eli Zaretskii
Subject: Re: Line height issues with display-line-number-mode
Date: Tue, 07 May 2019 21:31:23 +0300

> From: Clément Pit-Claudel <address@hidden>
> Date: Tue, 7 May 2019 12:40:02 -0400
> (with-current-buffer (get-buffer-create "*test*")
>   (insert "test\ntest\ntest")
>   (let ((ov (make-overlay 1 6))
>         (str (propertize "\n" 'face '(:height 1 :background "#edd400"))))
>     (overlay-put ov 'after-string str))
>   (pop-to-buffer (current-buffer)))
> With display-line-numbers-mode, however, the thin line to be a full character 
> tall.  I have attached screenshots.
> Is there a workaround for this issue?

Only if you customize the line-number face to be smaller.

I don't understand what do you want to see instead of a line number if
its face should use a higher font.  The Emacs display is a canvas, so
the height of a screen line is determined by the highest display
element on that screen line.

> More generally, is there a way to prevent line numbers from affecting the 
> height of the corresponding line?  For example in compact-docstrings I shrink 
> blank lines in documentation strings to half their usual height, but enabling 
> display-line-numbers-mode stretches those lines back to regular height.

As expected.  Make your line-number face half-height in those cases,
and you can have what you want.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]