From 300f5a27c8986f2ac9139394de439af0c694597e Mon Sep 17 00:00:00 2001 From: bntrtm Date: Sun, 22 Mar 2026 16:10:14 -0500 Subject: [PATCH] docs: amend inline docs for height calculation --- size.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/size.go b/size.go index e0384d03..fc3e2510 100644 --- a/size.go +++ b/size.go @@ -23,9 +23,9 @@ func Width(str string) (width int) { return width } -// Height returns height of a string in cells. This is done simply by -// counting \n characters. If your output has \r\n, that sequence will be -// replaced with a \n in [Style.Render]. +// Height returns height of a string in cells, calculated simply +// as 1 plus the number of \n characters. If your output has \r\n, +// that sequence will be replaced with a \n in [Style.Render]. func Height(str string) int { return strings.Count(str, "\n") + 1 }