conceal problem when I enable linebreak setting ...

84 views
Skip to first unread message

cs86661

unread,
Dec 9, 2014, 10:18:28 AM12/9/14
to vim...@googlegroups.com
example:

1. open test.c.

2. change settings.
:set list
:set listchars=tab:\|-
:syntax match Conceal conceal cchar=> 'AB'
:set conceallevel=1

3. problem setting, some chars disappeared ?!
:set lbr
test.c

Christian Brabandt

unread,
Dec 9, 2014, 3:07:34 PM12/9/14
to vim...@googlegroups.com
> #include <stdio.h>
>
> #define ABC 1
> #define ABCD 1
> #define ABCDE 1
>
> #define AB_C 1
> #define AB_CD 1
> #define AB_CDE 1
>
> int main()
> {
> return 0;
> }

Concealing, linebreak and listlbr features are getting considerably
complex. It is hard to understand what is going on.

I made a patch, that I think fixes this bug and includes a test as well,
but understanding that part of the line drawing code is quite complex. I
hope this doesn't cause any problems.

Best,
Christian
--
Ist der Begriff "Selbsthilfegruppe" nicht widersinnig?
listlbr_conceal_bug.diff

Bram Moolenaar

unread,
Dec 9, 2014, 11:03:51 PM12/9/14
to Christian Brabandt, vim...@googlegroups.com
Thanks, I'll put it on the list.

Conceal has always been a bit problematic. Linebreak isn't simple
either. So yes, the combination is very complex. And then we like to
keep it fast as well...

--
Back off man, I'm a scientist.
-- Peter, Ghostbusters

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

cs86661

unread,
Dec 9, 2014, 11:26:33 PM12/9/14
to vim...@googlegroups.com
thank you. I patch it into vim 7.4.542. It seems to be correct ...almost!

I found it has another problem, maybe I should not use this conceal feature. :(

example:

1. open test_2.c.

2. change settings.
:set list
:set listchars=tab:\|-
:syntax match Conceal conceal cchar=> 'MSG_MODE_'
:set conceallevel=1

3. problem setting, some tab char replace by spaces.
:set lbr
test_2.c

Christian Brabandt

unread,
Dec 11, 2014, 2:24:28 PM12/11/14
to vim...@googlegroups.com
Hi cs86661!

On Di, 09 Dez 2014, cs86661 wrote:

> #include <stdio.h>
>
> #define ABC 1
> #define ABCD 1
> #define ABCDE 1
>
> #define AB_C 1
> #define AB_CD 1
> #define AB_CDE 1
>
> #define MSG_MODE_FILE 0
> #define MSG_MODE_CONSOLE 1
> #define MSG_MODE_FILE_AND_CONSOLE 2
> #define MSG_MODE_FILE_THEN_CONSOLE 3
>
> int main()
> {
> return 0;
> }

Please check attached patch. That should fix both your problems and
includes a test.


Best,
Christian
--
Neue Viren:
Amnesty International Virus: Dieser Virus setzt sich in den oberen
Speicherbereich und führt automatisch ein Undelete aller gelöschten
Dateien durch.
listlbr_conceal_bug.diff

cs86661

unread,
Dec 11, 2014, 10:19:23 PM12/11/14
to vim...@googlegroups.com
YA~it looks perfect! Thank you very much! ^_^

Bram Moolenaar

unread,
Dec 11, 2014, 11:16:24 PM12/11/14
to Christian Brabandt, vim...@googlegroups.com
Thanks. Does this replace the patch of two days earlier?

--
Your company is doomed if your primary product is overhead transparencies.
(Scott Adams - The Dilbert principle)

Christian Brabandt

unread,
Dec 12, 2014, 7:31:27 AM12/12/14
to vim...@googlegroups.com
Hi Bram!

On Fr, 12 Dez 2014, Bram Moolenaar wrote:

> Thanks. Does this replace the patch of two days earlier?

Yes.

Best,
Christian
--
Wir unterschätzen das, was wir haben, und überschätzen das, was wir
sind.
-- Marie von Ebner-Eschenbach
Reply all
Reply to author
Forward
0 new messages