Replace buffer with a pretty-printed version