I've defined a few keypress triggers in my dynamic xml file, and I'm handling the TriggerActivated event. I'm just trying to add a matching character when the user types an initial double-quote (or single quote, etc.).
When the user types the first quote, for a moment all the text after it turns red because the lexer realizes that everything that follows is now in a child "string" state (whose style dictates that the text color should be red).
When my code inserts the second quote, all goes back to normal. But the momentary flash is unfortunate.
I've tried to wrap my insertion code with:
editor.Document.LexicalParsingEnabled = false;
editor.Document.SemanticParsingEnabled = false
... insert closing quote here ...
editor.Document.LexicalParsingEnabled = true;
editor.Document.SemanticParsingEnabled = true;
but this didn't help at all.
What's the right way to "pause" the parsing while I'm programmatically changing the text?
Or, maybe using triggers was the wrong idea in the first place?
Thanks!
Jeff
When the user types the first quote, for a moment all the text after it turns red because the lexer realizes that everything that follows is now in a child "string" state (whose style dictates that the text color should be red).
When my code inserts the second quote, all goes back to normal. But the momentary flash is unfortunate.
I've tried to wrap my insertion code with:
editor.Document.LexicalParsingEnabled = false;
editor.Document.SemanticParsingEnabled = false
... insert closing quote here ...
editor.Document.LexicalParsingEnabled = true;
editor.Document.SemanticParsingEnabled = true;
but this didn't help at all.
What's the right way to "pause" the parsing while I'm programmatically changing the text?
Or, maybe using triggers was the wrong idea in the first place?
Thanks!
Jeff