ensure proper line wrapping in the scratch buffer