reverted overzealous refactoring 
(can't call model.getAnchorIndex in selectRange - after clearing..)