[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/4 V7] display: support the scroll bar also when --softwrap
From: |
Marco Diego Aurélio Mesquita |
Subject: |
Re: [PATCH 2/4 V7] display: support the scroll bar also when --softwrap is used |
Date: |
Sat, 30 May 2020 20:55:00 -0300 |
On Thu, May 28, 2020 at 6:08 AM Benno Schulenberg <bensberg@telfort.nl> wrote:
>
> From: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
>
> A new member ('chunk_nr') is added to each 'linestruct', to store
> the serial number of the first chunk of that line, so that, when
> softwrap is on, the scroll-bar thing can be computed relative to
> chunks instead of relative to actual lines.
>
> To guarantee that 'chunk_nr' is correctly synced, the buffer is
> renumbered whenever the number of chunks in a line changes, and
> also when softwrap is toggled on, and when buffers are switched.
>
> Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
> Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
I think there is a problem with this approach. See: calculating
chunk_nr depends on:
extra_chunks_in, which depends on
get_chunk_and_edge, which depends on
get_softwrap_breakpoint, which needs
editwincols, which is only correctly calculated on confirm_margin.
This can be fixed by condionationally (if (ISSET(SOFTWRAP))) calling
renumber_from(openfile_edittop) after refresh_needed = TRUE on
confirm_margin.
I also think the buffer should be renumbered when the terminal is resized.
What do you think?