save and restore selection when swizzling text