I'm trying to check if an offset is inside an offset and found some code for it on these forums, however it always returned false for it being highlighted so i decided to check what was wrong. The following code shows a messagebox with "0" printed in it
TextEditor te = ((TextEditors.SelectedItem as TabItem).Content as TextEditor);
HighlightedLine hline = new HighlightedLine(te.Document, te.Document.GetLineByOffset(te.SelectionStart));
even though im checking from a selection which is inside a multiline comment.
Here's what im doing inside my highlighting class
private bool IsInComment(int offset, DocumentLine line)
HighlightedLine hline = new HighlightedLine(CurrentContext.Document, line);
return (hline.Sections.Any(s => s.Offset <= offset && s.Offset + s.Length >= offset && s.Color.Name == "Comment"));
and it always return false, not supported anymore?