Prevent editing XML tags

Topics: Developer Forum
May 23, 2013 at 6:07 AM
Is there a way to prevent the editing of XML tags apart from handling the keydown event and canceling it if the cursor is within a tag?
May 23, 2013 at 9:09 AM
The Scintilla component doesn't track the location of XML tags, so no, there isn't a simple option that you can use to disable editing of specific parts of text. The KeyDown event may not be the only way, but it seems to me to be the best way.
May 23, 2013 at 12:34 PM
Is there a way to see if the text surrounding the cursor is colored a specific way?
Developer
May 24, 2013 at 12:53 PM
You should be able to get the style at a specific position in the document. Check how I do it for custom lexers in the WPF branch.