Fix pasting multiple lines containing tabs.

An example of what this fixes is pasting "\ta\nb"

The tabs_rm needs to be taken into account when doing the check on line 1014 otherwise it will drop into the code for the cursor being in the middle when it should be at the end.