nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] [PATCH] display: scroll horizontally one column earlier


From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] display: scroll horizontally one column earlier
Date: Sun, 3 Mar 2019 15:23:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

Op 03-03-19 om 14:57 schreef Benno Schulenberg:
>  size_t get_page_start(size_t column)
>  {
> -     if (column < editwincols - 1 || ISSET(SOFTWRAP) || column == 0)
> +     if (column + 2 < editwincols || ISSET(SOFTWRAP) || column == 0)
>               return 0;
>       else if (editwincols > 8)
> -             return column - 7 - (column - 7) % (editwincols - 8);
> +             return column - 6 - (column - 6) % (editwincols - 8);

For symmetry, I would prefer to make this 'if (column + 4 < editwincols...'
and 'return column - 4 - (column - 4) ...', but then (on a default 80-column
terminal) the cursor would jump unnecessarily and unexpectedly soon to the
next "chunk".  So the above is a compromise, between fixing the issue and
scrolling as late as possible.

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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