slice loaded content if with -r ranges. This should fix ipython#1093