try {
if (positions != null) {
final String POS_CATEGORY= "myCategory"; //$NON-NLS-1$
doc.addPositionCategory(POS_CATEGORY);
doc.addPositionUpdater(new DefaultPositionUpdater(POS_CATEGORY) {
protected boolean notDeleted() {
int start= this.fOffset;
int end= start + this.fLength;
if (start < this.fPosition.offset && (this.fPosition.offset + this.fPosition.length < end)) {
this.fPosition.offset= end; // deleted positions: set to end of remove