
Hi,
For the WPF syntax editor I have section of text that I need to set the background color for. I do not wish to set the background color of the entire editor only certain lines. Is there a way that we can do this?
Thanks,
Kamal
Hi,
For the WPF syntax editor I have section of text that I need to set the background color for. I do not wish to set the background color of the entire editor only certain lines. Is there a way that we can do this?
Thanks,
Kamal
Hi Kamal,
Yes you can use classification tags to color the background of certain ranges of text. Several of the adornments QuickStarts show this kind of thing.
I was able to accomplish this using classification tags and lexical state pattern. However currently the highlighting stops at the end of each string whereas I would like the entire line to be highlighted. For example:
//This is the Start marker
//In code editing, variables are initialized with random values.
//True variable values will be assigned when the code is executed.
var tmp1 = 0.12789542;
var tmp2 = 0.29653338;
var tmp3 = 0.74635917;
//This is the end marker
I would like the entire lines (including the blank one) between the start/end string markers to be highlighted in gray. Could you possibly provide a example of how I could define a pattern group to accomplish this?
Hi Kamal,
I'm sorry but that isn't currently supported. We'll add a TODO list item for if the line terminator is included in the tagged region, to color through the visible line end.
In the meantime, you'd have to use the lower level adornment features to do it. Some QuickStarts show adornment examples.
Hi Kamal,
We wanted to let you know that this feature was added in one of the last several builds. You can set the IHighlightingStyle.BackgroundSpansVirtualSpace property to true to make the style render all the way to the right edge of the view.
Please log in to a validated account to post comments.