On 2019-05-20, Bram Moolenaar wrote:
> > > Solution: Only use the "extends" character when 'list' is on. (Hirohito
> > > Higashi, closes #4360)
> >
> > This change may be consistent, but is it helpful?
>
> It was a bit of a mistake to add these items in 'listchars', we are
> correcting that now.
>
> > It seems to me that extends and precedes provide basic UI
> > feedback akin to a scrollbar or the 'display' option, rather
> > than displaying special characters differently. I, and one
> > other I've spoken to, like to know if there is text hidden
> > off-screen, without having to keep 'list' enabled.
> >
> > Is anyone else bugged by this change, or does everyone
> > 'wrap' religiously?
>
> The todo list has a brief entry for this:
>
> Add something like 'fillchars' local to window, but allow for
> specifying a highlight name. Esp. for the statusline.
>
> So, the reason we didn't quickly add another option to make "extends"
> work when 'list' is off, is that we probably want to add some more
> functionality at the same time. That is keeping it local to the
> window, and being able to specify separate highlighting. This could be
> useful for other "filler" characters as well.
I would like to resolve this.
The most straightforward solution would be an option akin to
'showbreak' that would allow the extends and precedes characters to
be set globally or locally for the current window. However, that
would not address the other issues discussed in todo.txt, such as
window-local status line fill characters, and it sounds like Bram
would prefer one option with a number of optional items rather than
more individual options.
I propose using 'fillchars' for this purpose. The scope would be
changed from "global" to "global or local to window". Two items
would be added, copied from 'listchars':
item default Used for
extends:c '' Character to show in the last
column, when 'wrap' is off and the
line continues beyond the right of
the screen.
precedes:c '' Character to show in the first
column, when 'wrap' is off and there
is text preceding the character
visible in the first column.
Two highlight groups would also be added:
item highlight group
extends:c Extends
precedes:c Precedes
Both highlight groups would be initialized to "links to NonText".
I may not be understanding the comment in todo.txt:
Add something like 'fillchars' local to window, but allow for
specifying a highlight name. Esp. for the statusline.
Does that mean that the user should be able to set a local highlight
group _name_ for each item, and thereby have different item
highlighting in every window? If so, I'll change the proposal
accordingly.
Since it has been decided that 'listchars' applies only when 'list'
is on, I think the values of the 'listchars' extends and precedes
and the values of the 'fillchars' extends and precedes should be
independent. However, I think that if the user has set the value of
the 'fillchars' extends or precedes, then that value should be used
when 'list' is on and the corresponding 'listchars' item has not
been set.
A possible problem with making 'fillchars' global and local to
window is that it doesn't make sense to make the vert item local.
The vert item is a separator between windows, not a property of any
one window. I don't think that inconsistency would bother anyone,
though.
I'm not married to this proposal. My primary interest is in somehow
providing for the use of extends and precedes characters when 'list'
is off, as before this patch, without going through the hoops of
backing out the patch or using a plugin to leave 'list' on and
manage 'listchars' when the user sets 'list' to off or on, both of
which I've done.
Please let me know what you think. I have some time on my hands and
I think this would be an interesting and useful project.
Regards,
Gary