/// <summary> /// When the buffer changes, check to see if any of the edits were in a paragraph with multi-line tokens. /// If so, we need to send out a classification changed event for those paragraphs. /// </summary> void BufferChanged(object sender, TextContentChangedEventArgs e) { int eventsSent = 0; foreach (var change in e.Changes) { SnapshotSpan paragraph = GetEnclosingParagraph(new SnapshotSpan(e.After, change.NewSpan)); if (MarkdownParser.ParagraphContainsMultilineTokens(paragraph.GetText())) { eventsSent++; var temp = this.ClassificationChanged; if (temp != null) { temp(this, new ClassificationChangedEventArgs(paragraph)); } } } }