-
I'm using AvaloniaEdit and am using it as a replacement for a WPF RichTextBox I was using in a custom control. Look at the AE docs it says I need to implement IRegistryOptions but I can't find any examples of what any of the requirements are for doing so. This is all pretty complex stuff and I can't find anything to give me a nudge in the right direction. I found a message saying to look at the implementation for AvaloniaEdit but the link is now a 404 and looking over all the branches it seems to have vanished. My requirements are really simple. I just have a handful of key words to be green and a handful of keywords to be Red but I just cannot figure out what to do with the interface. It all seems geared up for a much more complex use case and I'm left struggling a bit to be honest. Are there any docs I'm missing or examples? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I don't think TextmateSharp is the piece you should use for that. I'd use AvaloniaEdit's transformers for that. Basically you need to write a line transformer that just change the chunk style when you find a match in your line. You can find a custom transformer here: https://github.com/AvaloniaUI/AvaloniaEdit/blob/master/src/AvaloniaEdit.TextMate/GenericLineTransformer.cs |
Beta Was this translation helpful? Give feedback.
-
Wow, took a few hours of reading code and tinkering but it's all working dream-like now. Many thanks for your excellent control and help. |
Beta Was this translation helpful? Give feedback.
I don't think TextmateSharp is the piece you should use for that. I'd use AvaloniaEdit's transformers for that.
Basically you need to write a line transformer that just change the chunk style when you find a match in your line.
You can find a custom transformer here: https://github.com/AvaloniaUI/AvaloniaEdit/blob/master/src/AvaloniaEdit.TextMate/GenericLineTransformer.cs