automagically switch paste mode