aboutsummaryrefslogtreecommitdiff
path: root/src/format.nim
diff options
context:
space:
mode:
authorkitsunyan2019-12-20 04:35:07 +0000
committerkitsunyan2019-12-20 04:35:07 +0000
commit90d4c4be3bc15b2f594a0046c07b6f8654659ad5 (patch)
tree89a79ffa58b086e5211473bb8633f5344e39000f /src/format.nim
parenta25e544b717edab821779b4e7d978e8bf24debcb (diff)
Add Nim 1.0 support
Diffstat (limited to 'src/format.nim')
-rw-r--r--src/format.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/format.nim b/src/format.nim
index f20eaf7..2ac39dc 100644
--- a/src/format.nim
+++ b/src/format.nim
@@ -1,5 +1,5 @@
import
- future, macros, options, posix, sequtils, strutils, times, unicode,
+ macros, options, posix, sequtils, strutils, sugar, times, unicode,
utils
type
@@ -94,8 +94,8 @@ proc splitLines(text: string, lineSize: int, lines: seq[string] = @[]): seq[stri
if index < 0:
lines & text
else:
- text[index .. ^1].strip.splitLines(lineSize,
- lines & text[0 .. index - 1].strip)
+ strutils.strip(text[index .. ^1]).splitLines(lineSize,
+ lines & strutils.strip(text[0 .. index - 1]))
proc printPackageInfo*(minPadding: int, color: bool, lines: varargs[PackageLineFormat]) =
let width = getWindowSize().width
@@ -108,9 +108,9 @@ proc printPackageInfo*(minPadding: int, color: bool, lines: varargs[PackageLineF
if values.len == 0:
@[]
elif forceBreak:
- lc[x | (y <- values.map(s => s.strip.splitLines(lineSize)), x <- y), string]
+ lc[x | (y <- values.map(s => strutils.strip(s).splitLines(lineSize)), x <- y), string]
else:
- values.map(v => v.strip).foldl(a & " " & b).splitLines(lineSize)
+ values.map(v => strutils.strip(v)).foldl(a & " " & b).splitLines(lineSize)
proc formatText(values: seq[string], forceBreak: bool): string =
let textSeq = formatTextLines(values, forceBreak)