pub fn lines(text: &str) -> usize
How many lines the text has. One trailing newline does not make it two lines — a copy from a terminal almost always carries one, and “2 line(s)” for one line reads like a bug.