[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28248: 26.0.50; display-line-numbers does not affect window-width /
From: |
Eli Zaretskii |
Subject: |
bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width |
Date: |
Tue, 17 Oct 2017 10:01:31 +0300 |
User-agent: |
K-9 Mail for Android |
On October 17, 2017 9:19:11 AM GMT+03:00, Steve Purcell <steve@sanityinc.com>
wrote:
> On 17 Oct 2017, at 15:34, Eli Zaretskii <eliz@gnu.org> wrote:
> >
> >> That would be the actual amount of "screen estate used up for
> >> line-number display".
> >>
> >> Can I rely on the extra value always being 2?
> >
> > As long as we don't change the implementation, yes. Alternatively,
> > you can call line-number-display-width with the optional argument
> and
> > get the result in pixels, in which case it includes everything (you
> > can divide by frame-char-width to get the result back in columns).
>
>
> Thanks, this is helpful. I have some code which calculates the width
> of the buffer contents in characters, and calculating this pixelwise
> works nicely for me.
>
> The odd thing is that there’s a one character discrepancy between
> graphical and terminal frames. It’s not related to the new line
> numbers support, since an adjustment for that discrepancy has always
> been necessary in the code, and the native line numbers are not
> present in the terminal anyway. Any idea where that one-column
> difference might be coming from?
>
> https://github.com/purcell/page-break-lines/blob/610dbdc9d39a37912e2b8bfbd3e3d15c7e5d622f/page-break-lines.el#L128-L134
The space reserved for the continuation glyph? Note that this can also happen
on GUI frames, if the user disables the fringes.
Wouldn't window-text-width suit your needs better?
- bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width, Dmitry Gutov, 2017/10/16
- bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width, Dmitry Gutov, 2017/10/17
- bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width, Eli Zaretskii, 2017/10/17
- bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width, Dmitry Gutov, 2017/10/17
- bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width, Eli Zaretskii, 2017/10/18
- bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width, Dmitry Gutov, 2017/10/18
- bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width, Eli Zaretskii, 2017/10/18
- bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width, Eli Zaretskii, 2017/10/20