Add code without duplicate undo