HTML syntax highlighting concepts
-
I am writing an HTML syntax highlighter for my MFC MDI app and I wrote a ParseAllLines function and it works perfectly for coloring the entire document. But I was wondering how to go about parsing/coloring as the user types into the rich edit control or pastes something into the document. Can anyone generally tell me what I need to do? Do I overwrite OnChange for the rich edit control? If so, what lines do I parse? I appreciate any advice, thank you!
-
I am writing an HTML syntax highlighter for my MFC MDI app and I wrote a ParseAllLines function and it works perfectly for coloring the entire document. But I was wondering how to go about parsing/coloring as the user types into the rich edit control or pastes something into the document. Can anyone generally tell me what I need to do? Do I overwrite OnChange for the rich edit control? If so, what lines do I parse? I appreciate any advice, thank you!
Handling EN_CHANGE message will tell you when text has changed, but I don't know how to get only the text that has changed. You might have to reparse the whole thing.