Problem with applying TextAttributesKey

Hello everybody,

In my plugin it is sometimes necessary to fix highlighting performed during the first level of highlighting(based on Lexer output).

Some tokens recognized as keywords highlight with SyntaxHighlighterColors.KEYWORD(dark-blue and bold).

Then, I try to rehighlight some of them and reapply highlight during Annotation level.

I use TextAttribute like:
static final TextAttributes TEXT_ATTR = new TextAttributes(new Color(0,0,0), null, null, null, Font.PLAIN);

But it leads to only changing color! Weight is still to be BOLD.

Any suggestions?

Need to note, that new TextAttributes(new Color(0,0,0), null, null, null, Font.ITALIC) works.

Thanks.

1 comment

Hello Nikolay,

This is a known limitation - the text style provided by you is combined with
the text style from previous layers. At the moment there is no way to force
setting the style to plain.

Hello everybody,

In my plugin it is sometimes necessary to fix highlighting performed
during the first level of highlighting(based on Lexer output).

Some tokens recognized as keywords highlight with
SyntaxHighlighterColors.KEYWORD(dark-blue and bold).

Then, I try to rehighlight some of them and reapply highlight during
Annotation level.

I use TextAttribute like:
static final TextAttributes TEXT_ATTR = new TextAttributes(new
Color(0,0,0), null, null, null, Font.PLAIN);
But it leads to only changing color! Weight is still to be BOLD.

Any suggestions?

Need to note, that new TextAttributes(new Color(0,0,0), null, null,
null, Font.ITALIC) works.

Thanks.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5260832#5260832

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.