From a14e7b19e20ba921100ac2844cbaca386c0f48e6 Mon Sep 17 00:00:00 2001 From: Arpad Ryszka Date: Wed, 21 Jan 2026 22:35:47 +0100 Subject: [PATCH] documentation fixes --- lib.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib.go b/lib.go index cded859..08d2558 100644 --- a/lib.go +++ b/lib.go @@ -82,8 +82,8 @@ func Indent(first, rest string) Editor { return indent([]rune(first), []rune(rest)) } -// Wrap wrap wraps multiline text to define maximual text width. Duplicate, leading, trailing and non-space -// whitespaces are collapsed into a single space. +// Wrap wraps text to the defined maximum text width. Duplicate, leading, trailing and non-space whitespaces are +// collapsed into a single space. func Wrap(firstWidth, restWidth int) Editor { return wrapIndent(nil, nil, firstWidth, restWidth) } @@ -151,7 +151,7 @@ func (w *Writer) flush() error { } // Write calls the configured editors with the input and forwards their output to the underlying io.Writer. It -// always returns len(p) as the number bytes written. It only returns an error when the underlying writer +// always returns len(p) as the number of bytes written. It only returns an error when the underlying writer // returns and error. func (w *Writer) Write(p []byte) (int, error) { return len(p), w.write([]rune(string(p))) @@ -159,13 +159,13 @@ func (w *Writer) Write(p []byte) (int, error) { // WriteRune calls the configured editors with the input and forwards their output to the underlying io.Writer. // It always returns byte length of the input rune as the number bytes written. It only returns an error when -// the underlying writer returns and error. +// the underlying writer returns an error. func (w *Writer) WriteRune(r rune) (int, error) { return len([]byte(string(r))), w.write([]rune{r}) } // Flush makes the underlying editors to release their associated state, and writes out the resulting text to -// the underlying io.Writer, but first passes it to the subsequent editors for editing. Is there were no errors, +// the underlying io.Writer, but first passes it to the subsequent editors for editing. If there were no errors, // and the used editor instances comply with the expectations of the Editor interface, the writer will have a // fresh state and can be reused for further editing. The Flush method of underlying writers is not called. func (w *Writer) Flush() error {