Highlighting style not applied correctly

SyntaxEditor for WPF Forum

Posted 2 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Version: 22.1.3
Platform: .NET 4.8
Environment: Windows 10 (64-bit)
Avatar

Hi,

we use a default style that sets a background and foreground color for most scenarios. If another style only modifies the foreground color, the background color remains null. According to your documentation the background color from the default style should be applied then.

However this only works if the token is surrounded by whitespaces. This specifically doesn't work for the first token in any given line, unless it is a whitespace.

As a workaround we use the background from our default style as fallback instead of null. But it would be easier if we just could use null instead.


Best regards, Tobias Lingemann.

Comments (2)

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tobias,

I tried to recreate what you are describing, but could not. Highlighting styles and the various scenarios in which they are applied can be complex, so I'm likely not replicating precisely what you're doing.

Would you be able to create a simple sample project that demonstrates how you define the default style and how you are applying the style that doesn't render correctly with a null background? If so, please attach to an email to our support email address and reference this forum post in the email. Please remove any bin/obj folders before zipping or the attachment will be blocked.  Alternatively, steps to reproduce it using one of our samples works just as well.


Actipro Software Support

Answer - Posted 2 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar

Okay, I see what I did wrong here. We forgot to register the default style to DisplayItemClassificationTypeProvider.PlainText. After we did that, everything works as expected.


Best regards, Tobias Lingemann.

The latest build of this product (v24.1.3) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.