protected override void OnDocumentChanged(TextDocument oldDocument, TextDocument newDocument)
{
if (oldDocument != null) {
TextDocumentWeakEventManager.LineCountChanged.RemoveListener(oldDocument, this);
}
base.OnDocumentChanged(oldDocument, newDocument);
if (newDocument != null) {
TextDocumentWeakEventManager.LineCountChanged.AddListener(newDocument, this);
}
OnDocumentLineCountChanged();
}