diff options
Diffstat (limited to 'src/format.nim')
-rw-r--r-- | src/format.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/format.nim b/src/format.nim index 2ac39dc..b8061f9 100644 --- a/src/format.nim +++ b/src/format.nim @@ -1,6 +1,6 @@ import macros, options, posix, sequtils, strutils, sugar, times, unicode, - utils + utils, "listcomp" type PackageLineFormat* = tuple[ @@ -83,7 +83,9 @@ proc splitLines(text: string, lineSize: int, lines: seq[string] = @[]): seq[stri if not addBreaks: lines & text else: - let offset = text.runeOffset(lineSize) + var offset : int = -1 + if text.len() != 0: + offset = text.runeOffset(lineSize) if offset < 0: lines & text else: |