Made extendSelection aware of activeSegment.