| Problem with MultiLineRule [message #448337] |
Fri, 21 April 2006 02:52  |
Eclipse User |
|
|
|
Hi!
I have a problem with a MultiLineRule in the SourceViewerConfiguration of my
editor.
I created a rule for comment swith the following code:
private IRule createMultiLineCommentRule()
{
IToken procToken = new Token(new TextAttribute(new
Color(Display.getCurrent(),Configuration.JPL_COLOR_COMMENT)) );
// procToken gets active when line begins with '//'
MultiLineRule procRule = new MultiLineRule("/*","*/",procToken);
return procRule;
}
The rules works, but the words affected are not highlighted directly after
the rule matches.
Sometimes I have to re-open the file in the editor, then the words are
highlighted correctly.
Can anyone help me with this problem?
Thanks!
Greetz
Carsten
|
|
|
| Re: Problem with MultiLineRule [message #448338 is a reply to message #448337] |
Fri, 21 April 2006 02:59   |
Eclipse User |
|
|
|
Carsten, AFAIK, syntax highlighting is line-based, which would mean that
MultiLineRule cannot be used for syntax coloring, but only for partitioning.
-tom
Carsten Spieker wrote:
> Hi!
>
> I have a problem with a MultiLineRule in the SourceViewerConfiguration of my
> editor.
>
> I created a rule for comment swith the following code:
>
> private IRule createMultiLineCommentRule()
> {
> IToken procToken = new Token(new TextAttribute(new
> Color(Display.getCurrent(),Configuration.JPL_COLOR_COMMENT)) );
>
> // procToken gets active when line begins with '//'
> MultiLineRule procRule = new MultiLineRule("/*","*/",procToken);
> return procRule;
> }
>
> The rules works, but the words affected are not highlighted directly after
> the rule matches.
> Sometimes I have to re-open the file in the editor, then the words are
> highlighted correctly.
>
> Can anyone help me with this problem?
>
> Thanks!
>
> Greetz
> Carsten
>
>
|
|
|
| Re: Problem with MultiLineRule [message #448339 is a reply to message #448338] |
Fri, 21 April 2006 03:16  |
Eclipse User |
|
|
|
Hi Tom,
thanks for your reply.
But when I use the MultiLineRule with a special token, the lines affected
by this rule are colored with the attributes given in that token. I meant
this with
highlighting in this case. And this "highlighting" isn
|
|
|
| Re: Problem with MultiLineRule [message #448340 is a reply to message #448339] |
Fri, 21 April 2006 03:15  |
Eclipse User |
|
|
|
Carsten Spieker wrote:
> But when I use the MultiLineRule with a special token, the lines affected
> by this rule are colored with the attributes given in that token. I meant
> this with
> highlighting in this case. And this "highlighting" isn´t updated
> immediately.
I believe this is due exactly to what I said before: intially, the
multi-line rule works, but the incremental updating (damage & repair)
doesn't work. AFAIR, I tried this a couple weeks back and found that
DefaultDamagerRepairer did not work with MultiLineRule.
tom
|
|
|
Powered by
FUDForum. Page generated in 0.03620 seconds