pModel.expand(annotation);
Position newPos = new Position(pos.offset-selectionOffset,pos.length);
annotationList.add(new AnnotationPosition(annotation,newPos,collapsed));
// Remove the annotation for now.
pModel.removeAnnotation(annotation);
}
// The annotation starts in the selection, but doesn't end in it.
else if(pos.offset >= selectionOffset
&& pos.offset <= selectionOffset + length
&& pos.offset + pos.length >= selectionOffset + length) {