Keep undo history when switching buffers