aboutsummaryrefslogtreecommitdiff
path: root/src/format.nim
diff options
context:
space:
mode:
authorshirleyquirk2020-08-04 23:53:21 +0000
committerGitHub2020-08-04 23:53:21 +0000
commit731f8d7692bfe08f5fd5890a98797f9b1b8d065d (patch)
tree512a18c53d4e7e6878ea134a2a307e3caec2278d /src/format.nim
parent29e12415d4bae7a08fa9f3024d809b5a3be76ba1 (diff)
parentb2321b0ded6f4a9803daf9dbcbd88d56321a9305 (diff)
Merge branch 'lc_useVersion' into collect
Diffstat (limited to 'src/format.nim')
-rw-r--r--src/format.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/format.nim b/src/format.nim
index 3ed7b58..f85733a 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: