You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project using AvaloniaEdit (Thank you for porting this by the way, it has made life so much easier for me) and it basically needs to be able to keep regular text black, color negative numbers red and make all alphabetical characters green.
I have this working for the most part using DocumentColorizingTransformer. The problem is when I am parsing the lines to do calculations, I take TextEditor.Document.Text and split that string to start working with it. I then take it all at the end and reformat the string back to the way it was with new additions and put it back into Document.Text.
The problem is that when I do that, a lot of the text transformations disappear. Is there a better (recommended) way of working with the lines in a document? (I did discover Document.GetText(line) but Document.Lines is read only so working with it in a list and putting the lines back is a no go.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Edit: Never mind, I figured out my issue.
I am working on a project using AvaloniaEdit (Thank you for porting this by the way, it has made life so much easier for me) and it basically needs to be able to keep regular text black, color negative numbers red and make all alphabetical characters green.
I have this working for the most part using DocumentColorizingTransformer. The problem is when I am parsing the lines to do calculations, I take TextEditor.Document.Text and split that string to start working with it. I then take it all at the end and reformat the string back to the way it was with new additions and put it back into Document.Text.
The problem is that when I do that, a lot of the text transformations disappear. Is there a better (recommended) way of working with the lines in a document? (I did discover Document.GetText(line) but Document.Lines is read only so working with it in a list and putting the lines back is a no go.
Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions