Move insert_final_newline to general block.