fn truncate_lines(lines: &[&str], max: usize) -> (String, bool)
Truncates lines to the given maximum, returning the joined string and whether truncation occurred.