Is it possible to determine the current highlighter affecting the text at the current cursor position. For example if I wanted to take one action if in the HTML section of an HTML document and another if in the JS section?
Thank you.
Determine current highlighter
Re: Determine current highlighter
For posterity:
This is now possible in versions 11.20+.
This is now possible in versions 11.20+.
For example:Scripts
Added a new property to the document object to get the current highlighter at the cursor position. The name is returned as a string in lower case.
Code: Select all
var currentHighlighter = Document.HighlighterAtCursor;
if ((currentHighlighter == "html") || (currentHighlighter == "xml")) {
Document.SelText = "<!--" + Document.SelText + "-->";
} else {
Document.SelText = "/*" + Document.SelText + "*/";
}