fill region

This commit is contained in:
Arne Döring 2018-11-08 10:08:52 +01:00 • committed by Andreas Rumpf
commit 4f787ac4f4

View file

@ -5,8 +5,10 @@ proc wordWrap*(s: string, maxLineWidth = 80,
newLine = "\n"): string = newLine = "\n"): string =
## This function breaks all words that reach over `maxLineWidth` ## This function breaks all words that reach over `maxLineWidth`
## measured in number of runes. When `splitLongWords` is `true` ## measured in number of runes. When `splitLongWords` is `true`
## words that are longer than `maxLineWidth` are splitted. Multiple spaces and newlines are converted to a single space. All ## words that are longer than `maxLineWidth` are splitted. Multiple
## whitespace is treated equally. Non-breaking whitespace is ignored. ## spaces and newlines are converted to a single space. All
## whitespace is treated equally. Non-breaking whitespace is
## ignored.
var currentWordLength: int = 0 var currentWordLength: int = 0
var currentWord: string = newStringOfCap(32) var currentWord: string = newStringOfCap(32)