Smart open newline