On Sun, April 10, 2011 9:45 pm, Bram Moolenaar wrote:
> Christian Brabandt wrote:
>> On So, 10 Apr 2011, Bram Moolenaar wrote:
>> > Can you explain what the effect is?
>> Basically, I wanted to create a plugin that uses concealing for
>> something like vertical folding. I tried to dynamically conceal columns
>> using :call matchadd(), but this only highlights the region, it does not
>> conceal it, no matter what 'cole' is set to. So instead, I started using
>> :syn match commands. Problem here is, you can't really remove matches
>> and it is not that easy to use.
>>
>> There is still a problem, that cursor movement won't skip over concealed
>> text. I am currently thinking about creating a patch for that as well,
>> e.g. when cole is set to 4 (it currently allows only 3). But I don't
>> know how easy that is to implement, it would have to be done on a lot of
>> places.
>>
>> > Perhaps we also need an update to
>> > the documentation. And an example to show the effect.
>>
>> I Don't think so. I expect, that when cole is set to 3, that a :call
>> matchadd('Conceal', 'foobar') conceals the foobar part
>> and not to have it highlighted. I would even consider this a bug.
>
> No, using the "Conceal" group only means it's highlighted like
> characters replaced by the conceal feature, not that they are not
> displayed.

Too bad. I find it really useful to be able to hide certain parts
of a buffer, when it is not needed (think of hiding time stamps in
log files or columns in large csv-files) I know I can use syn match,
but that has problems to selectively remove those hidden parts or when
other syntax highlighting take precedence.

> You will have to do more than setting the highlighting group, something
> similar to the cchar and conceal arguments to :syn.

Actually, I like the way the patch worked. When cole was zero, nothing
would have changed to how it worked before, when set to 1 or 2, it would
use the 'listchars' setting and with 3, the text would be completely
hidden. I don't have an idea how to set the cchar via the matchadd()
function.

The patch itsself was small and didn't change concealing at all,
just the way when concealing happened.

> You will also have to fix the cursor movement and any other related
> problems before I would include this.  Experience with the conceal
> feature has learned us that it can easily trigger more problems, thus we
> also need tests.

Yes probably, that's why I haven't done it yet. You don't sound like
this would be worth the trouble, so I probably won't try to implement it
myself.

regards,
Christian

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui