Bram Moolenaar | 18 May 13:28 2012
Picon
Picon

Make tabs in conceal mode work like there is no concealing


Currently there is the problem that if characters are concealed before a
Tab then the position of the text after the Tab may change, depending on
whether the gap that the Tab covers goes over the tab size.
This is most noticeable at ":help index".

We already have code to keep line wrapping in the same place when there
are concealed characters.  I think we should do the same for Tabs, so
that the column alignment stays the same.  That means that when there
are concealed characters the virtual column is computed as if they are
not concealed and the text after the Tab is positioned in the same place
with and without concealed characters.

At the same time, it would be useful to do the opposite: Really ignore
the concealed characters, also for line wrapping.  This would be a
conceal setting.

I'm sending this to Christian since he did some work in this area
before.  There is also the open issue of 'cursorline' being displayed to
short, I think that's related.

--

-- 
LARGE MAN:   Who's that then?
CART DRIVER: (Grudgingly) I dunno, Must be a king.
LARGE MAN:   Why?
CART DRIVER: He hasn't got shit all over him.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram <at> Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
(Continue reading)

Dominique Pellé | 18 May 13:43 2012
Picon

Re: Make tabs in conceal mode work like there is no concealing

Bram Moolenaar <Bram <at> moolenaar.net> wrote:

> Currently there is the problem that if characters are concealed before a
> Tab then the position of the text after the Tab may change, depending on
> whether the gap that the Tab covers goes over the tab size.
> This is most noticeable at ":help index".
>
> We already have code to keep line wrapping in the same place when there
> are concealed characters.  I think we should do the same for Tabs, so
> that the column alignment stays the same.  That means that when there
> are concealed characters the virtual column is computed as if they are
> not concealed and the text after the Tab is positioned in the same place
> with and without concealed characters.

Hi Bram

That sounds exactly like a patch that I proposed. See this thread:

http://www.mail-archive.com/vim_dev <at> googlegroups.com/msg16721.html

I also noticed that todo.txt does not mention this patch (perhaps it
was forgotten).
It was suggested to create a test for this patch, but I did not
succeed creating the test.

I found afterwards that the proposed patch was also fixing 2 other issues
as described in above link.

> At the same time, it would be useful to do the opposite: Really ignore
> the concealed characters, also for line wrapping.  This would be a
(Continue reading)

Bram Moolenaar | 18 May 14:44 2012
Picon
Picon

Re: Make tabs in conceal mode work like there is no concealing


Dominique Pelle wrote:

> Bram Moolenaar <Bram <at> moolenaar.net> wrote:
> 
> > Currently there is the problem that if characters are concealed before a
> > Tab then the position of the text after the Tab may change, depending on
> > whether the gap that the Tab covers goes over the tab size.
> > This is most noticeable at ":help index".
> >
> > We already have code to keep line wrapping in the same place when there
> > are concealed characters.  I think we should do the same for Tabs, so
> > that the column alignment stays the same.  That means that when there
> > are concealed characters the virtual column is computed as if they are
> > not concealed and the text after the Tab is positioned in the same place
> > with and without concealed characters.
> 
> Hi Bram
> 
> That sounds exactly like a patch that I proposed. See this thread:
> 
> http://www.mail-archive.com/vim_dev <at> googlegroups.com/msg16721.html
> 
> I also noticed that todo.txt does not mention this patch (perhaps it
> was forgotten).
> It was suggested to create a test for this patch, but I did not
> succeed creating the test.
> 
> I found afterwards that the proposed patch was also fixing 2 other issues
> as described in above link.
(Continue reading)


Gmane