Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ public void setDocument(IDocument document, IAnnotationModel annotationModel, in
}

if (fProjectionAnnotationModel != null) {
removeDocumentUpdateListener();
wasProjectionEnabled= removeProjectionAnnotationModel(getVisualAnnotationModel()) != null;
fProjectionAnnotationModel= null;
}
Expand All @@ -413,6 +414,15 @@ public void setDocument(IDocument document, IAnnotationModel annotationModel, in

}

private void removeDocumentUpdateListener() {
if (fUpdateDocumentListener != null) {
IDocument document= getDocument();
if (document != null) {
document.removeDocumentListener(fUpdateDocumentListener);
}
}
}

@Override
protected IAnnotationModel createVisualAnnotationModel(IAnnotationModel annotationModel) {
IAnnotationModel model= super.createVisualAnnotationModel(annotationModel);
Expand Down Expand Up @@ -554,10 +564,7 @@ public final void disableProjection() {
super.setVisibleRegion(fVisibleRegionDuringProjection.getOffset(), fVisibleRegionDuringProjection.getLength());
fVisibleRegionDuringProjection= null;
}
IDocument document= getDocument();
if (document != null) {
document.removeDocumentListener(fUpdateDocumentListener);
}
removeDocumentUpdateListener();
}
}

Expand Down Expand Up @@ -1480,12 +1487,7 @@ private boolean willAutoExpand(Position position, int offset, int length) {
@Override
protected void handleDispose() {
fWasProjectionEnabled= false;
if (fUpdateDocumentListener != null) {
IDocument document= getDocument();
if (document != null) {
document.removeDocumentListener(fUpdateDocumentListener);
}
}
removeDocumentUpdateListener();
super.handleDispose();
}

Expand Down
Loading