@@ -23,14 +23,14 @@ type WordWrap struct {
23
23
Newline []rune
24
24
KeepNewlines bool
25
25
HardWrap bool
26
- TabReplace string // since tabs can have differrent lenghts , replace them with this when hardwrap is enabled
26
+ TabReplace string // since tabs can have differrent lengths , replace them with this when hardwrap is enabled
27
27
PreserveSpaces bool
28
28
29
29
buf bytes.Buffer // processed and, in line, accepted bytes
30
30
space bytes.Buffer // pending continues spaces bytes
31
31
word ansi.Buffer // pending continues word bytes
32
32
33
- lineLen int // the visible lenght of the line not accorat for tabs
33
+ lineLen int // the visible length of the line not accorat for tabs
34
34
ansi bool
35
35
36
36
wroteBegin bool // mark is since the last newline something has writen to the buffer (for ansi restart)
@@ -65,7 +65,7 @@ func String(s string, limit int) string {
65
65
}
66
66
67
67
// HardWrap is a shorthand for declaring a new hardwraping WordWrap instance,
68
- // since varibale lenght characters can not be hard wraped to a fixed lenght ,
68
+ // since varibale length characters can not be hard wraped to a fixed length ,
69
69
// tabs will be replaced by TabReplace, use according amount of spaces.
70
70
func HardWrap (s string , limit int , tabReplace string ) string {
71
71
f := NewWriter (limit )
@@ -77,7 +77,7 @@ func HardWrap(s string, limit int, tabReplace string) string {
77
77
return f .String ()
78
78
}
79
79
80
- // addes pending spaces to the buf(fer) ... and resets the space buffer
80
+ // addes pending spaces to the buf(fer) and then resets the space buffer.
81
81
func (w * WordWrap ) addSpace () {
82
82
// the line and the pending spaces are less than the limit
83
83
if w .lineLen + w .space .Len () <= w .Limit {
@@ -231,13 +231,13 @@ func (w *WordWrap) Close() error {
231
231
}
232
232
233
233
// Bytes returns the word-wrapped result as a byte slice.
234
- // Make sure to have closed the worwrapper, befor calling it
234
+ // Make sure to have closed the worwrapper, befor calling it.
235
235
func (w * WordWrap ) Bytes () []byte {
236
236
return w .buf .Bytes ()
237
237
}
238
238
239
239
// String returns the word-wrapped result as a string.
240
- // Make sure to have closed the worwrapper, befor calling it
240
+ // Make sure to have closed the worwrapper, befor calling it.
241
241
func (w * WordWrap ) String () string {
242
242
return w .buf .String ()
243
243
}
0 commit comments