Heading colorization problem with doublebyte characters

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Heading colorization problem with doublebyte characters

apparit
Hello,

I tried vimoutliner-0.3.4 with doublebyte characters (Japanese),
and found a problem when used with doublebyte characters.

Colors used for headings below the top level seem to be wrong
when the heading has another heading of same level before it
and the first character of the heading is doublebyte one.
For example,
---
Heading1
    Heading2-1
    Heading2-2
---
In above case, Heading 2-2 is colored like Heading1, if the first character of Heading2-2 is doublebyte.
It makes some confusion when used for outlining.

I checked ${HOME}/syntax/vo_base.vim and found a sentence below:
---
syntax region OL2 start=+^\t[^:\t]+ end=+^\t[^:\t]+me=e-2
contains=outlTags,BT2,BT3,PT2,PT3,TA2,TA3,UT2,UT3,UB2,UB3,spellErr,
SpellErrors,BadWord,OL3 keepend
---

I temporary modified me=e-2 to me=s-1, and made similar modifications for other levels.
So far this seems to fix the behavior.

I am not familiar with vim programming, but it seems that
when "[^:\t]" matches first doublebyte character,
the offset (me=e-2) treats as if this were two characters and marks the region wrongly.
If this is true, me=e-[number] in other positions may also make similar problems.

Please check if this is true or not,
and I hope this will be fixed in future releases.
My vim version which caused this problem was 7.0 and 6.x
(I forgot exact version number for 6.x).

Please execuse me for poor English.
Best wishes,
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: Heading colorization problem with doublebyte characters

Steve Litt
On Tuesday 03 October 2006 10:02 am, [hidden email] wrote:

> Hello,
>
> I tried vimoutliner-0.3.4 with doublebyte characters (Japanese),
> and found a problem when used with doublebyte characters.
>
> Colors used for headings below the top level seem to be wrong
> when the heading has another heading of same level before it
> and the first character of the heading is doublebyte one.
> For example,
> ---
> Heading1
>     Heading2-1
>     Heading2-2
> ---
> In above case, Heading 2-2 is colored like Heading1, if the first character
> of Heading2-2 is doublebyte. It makes some confusion when used for
> outlining.
>
> I checked ${HOME}/syntax/vo_base.vim and found a sentence below:
> ---
> syntax region OL2 start=+^\t[^:\t]+ end=+^\t[^:\t]+me=e-2
> contains=outlTags,BT2,BT3,PT2,PT3,TA2,TA3,UT2,UT3,UB2,UB3,spellErr,
> SpellErrors,BadWord,OL3 keepend
> ---
>
> I temporary modified me=e-2 to me=s-1, and made similar modifications for
> other levels. So far this seems to fix the behavior.
>
> I am not familiar with vim programming, but it seems that
> when "[^:\t]" matches first doublebyte character,
> the offset (me=e-2) treats as if this were two characters and marks the
> region wrongly. If this is true, me=e-[number] in other positions may also
> make similar problems.
>
> Please check if this is true or not,
> and I hope this will be fixed in future releases.
> My vim version which caused this problem was 7.0 and 6.x
> (I forgot exact version number for 6.x).
>
> Please execuse me for poor English.
> Best wishes,

Hi,

Just to make sure it really has to do with Japanese 2 byte characters, could
you please try it with regular ascii and see if the symptom goes away? If it
does, we need to troubleshoot the character set. If it doesn't, there's
something else we need to troubleshoot.

STeveT
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Heading colorization problem with doublebyte characters

apparit
Thank you for reply,

> Just to make sure it really has to do with Japanese 2 byte characters, could
> you please try it with regular ascii and see if the symptom goes away? If it
> does, we need to troubleshoot the character set. If it doesn't, there's
> something else we need to troubleshoot.

With regular ASCII characters, I could not reproduce the symptom.

As far as I tested, putting one or more ASCII characters at tha head of each heading
appears to prevent VO-colors from showing incorrect levels,
even if the following characters of the heading are all Japanese ones.

Character sets I used for Japanese characters were EUC-JP and Shift_JIS,
and both seem to show this symptom.
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: Heading colorization problem with doublebyte characters

Stefan Schmiedl
In reply to this post by apparit
[hidden email] (03.10. 23:02):

> Hello,
>
> I tried vimoutliner-0.3.4 with doublebyte characters (Japanese),
> and found a problem when used with doublebyte characters.
>
> I checked ${HOME}/syntax/vo_base.vim and found a sentence below:
> ---
> syntax region OL2 start=+^\t[^:\t]+ end=+^\t[^:\t]+me=e-2
> ---
>
> I temporary modified me=e-2 to me=s-1, and made similar modifications
> for other levels.
> So far this seems to fix the behavior.

And as far as I understand the vim docs, it is the correct fix.
me=e-2 counts from the end of the match, while s-1 backs up from
the starting point of the match, i.e. the start of the line.

So even if you're ending up in the "middle" of the two-byte linebreak,
the region obviously ends before it.

I'd say you did a very good job nailing this thing down.

> Please execuse me for poor English.

What poor English?

s.
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner