better implementation for wrapWords
This commit is contained in:
parent
4f787ac4f4
commit
56f76c5b08
2 changed files with 80 additions and 58 deletions
|
|
@ -1211,7 +1211,8 @@ proc wordWrap*(s: string, maxLineWidth = 80,
|
|||
splitLongWords = true,
|
||||
seps: set[char] = Whitespace,
|
||||
newLine = "\n"): string {.
|
||||
noSideEffect, rtl, extern: "nsuWordWrap".} =
|
||||
noSideEffect, rtl, extern: "nsuWordWrap",
|
||||
deprecated: "use wrapWords in std/wordwrap instead".} =
|
||||
## Word wraps `s`.
|
||||
result = newStringOfCap(s.len + s.len shr 6)
|
||||
var spaceLeft = maxLineWidth
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue