Truncates to maxLines lines, appending ellipsis on the last line if truncated. Example: "a\nb\nc\nd".truncateLines(2) → "a\nb..."
"a\nb\nc\nd".truncateLines(2)
"a\nb..."