try {
document.removePosition(fSelectionCategory, position);
Point currentSelection= getSelectedRange();
if (currentSelection == null || currentSelection.x != position.getOffset() || currentSelection.y != position.getLength()) {
if (position instanceof ColumnPosition && getTextWidget().getBlockSelection()) {
setSelection(new BlockTextSelection(document, document.getLineOfOffset(position.getOffset()), ((ColumnPosition) position).fStartColumn, document.getLineOfOffset(position.getOffset() + position.getLength()), ((ColumnPosition) position).fEndColumn, getTextWidget().getTabs()));
} else {
setSelectedRange(position.getOffset(), position.getLength());
}
}