nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] [RFC] vertical scroll arrows


From: Benno Schulenberg
Subject: Re: [Nano-devel] [RFC] vertical scroll arrows
Date: Sat, 17 Mar 2018 15:36:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Op 16-03-18 om 01:57 schreef Brand Huntsman:
> Assume the file contains 20 lines of text and the 21st line is blank. If 
> editwinrows is 20, then scrollbar will be empty, because the entire file is 
> displayed. The last blank line is irrelevant, I assume nano adds it to every 
> buffer and never removes it.

Yes, if you don't set 'nonewlines'.

> Counting that blank line means a down arrow would be displayed, even though 
> the entire file is visible.

True, all of the text is visible, but not all of the available lines.

> And in the first example, when 4 lines are scrolled off the top the last blank
> line won't be visible yet, so we must display 100% in the scrollbar.

No, it would need to display 80%, because it needs to scroll five lines
before the final (empty) line is visible.

> Ignoring it gets rid of the 100% and excludes an irrelevant line from the 
> count.

If people want to get rid of the irrelevant line, they should use
'nonewlines'.

>> Emacs works differently, it goes: Top, 7%, 7%, 12%, 17%, 20%, Bot.  It shows
>> how much of the text has been scrolled off the top of the screen 
>> (characterwise, not linewise).
> 
> That doesn't make any sense, it gives no indication how far away the bottom 
> is.

It does, but indirectly, when calculating the percentage linewise.

For example, when at the top of the buffer, and we scroll down three
lines, and then the scroll indicator says 3%, then we now that the
file is roughly 100 lines.  If, after those three lines, the indicator
says 10%, then the file is apparently roughly 30 lines long.  If the
edit window is around 20 lines, then the user can infer that the end
of the buffer is roughly seven more line-scrolls away.

But generally, I think, the user doesn't need to know the position
very precisely.  What I would want is to know what percentage of the
lines of the buffer are scrolled off the top of the screen.  If you
put the cursor in the top-left corner of the edit window, the first
percentage of --constantshow would then be the same as the one in
the scroll indicator.

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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