nano-devel
[Top][All Lists]
Advanced

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

Re: having a scroll bar also in softwrap mode


From: Benno Schulenberg
Subject: Re: having a scroll bar also in softwrap mode
Date: Thu, 7 May 2020 20:47:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

Op 06-05-2020 om 21:32 schreef Marco Diego Aurélio Mesquita:
> This probably happens because chunk_nr is not renumbered when softwrap
> is toggled. My solution is to renumber all buffers from the top
> whenever the screen is resized or when softwrap is toggled.

After some quick tests, the behavior looks good now.  Thanks.

But renumbering *all* buffers when softwrap is toggled or the screen
is resized seems like the wrong approach.  I think this should be done
in redecorate_after_switch() -- there is already a relevant check for
this there.  And is it necessary to renumber the buffer also when
softwrap was turned off?

> +     newnode->chunk_nr = (prevnode) ?
> +             number_of_chunks_in(prevnode) + prevnode->chunk_nr + 1
> +             : 1;

This is poor style: three characters on a line by itself?  There is
more than enough remaining room on the previous line.

>       dst->lineno = src->lineno;
> +     dst->chunk_nr = src->chunk_nr;
>  #ifndef NANO_TINY

The chunk_nr should not be present in the tiny version.  Move or
put the relevant things between #ifndefs.

> +#ifndef NANO_TINY
> +     if (thebar)
> +             draw_scrollbar();
> +#endif

Why is this needed?  I removed it from your original patch (the one
without the softwrapping), why has it returned?

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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