summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorVindaar <basti90@gmail.com>2018-10-18 14:47:47 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-10-18 14:47:47 +0200
commit82a1576263c3c64f7a171710c747acc5fa62a52c (patch)
tree734fdac3e335457c0eaacfb5021bf48ca45c86ba /lib
parent1fe949b9d5f3b5128fe44fd566c434648e880eb1 (diff)
downloadNim-82a1576263c3c64f7a171710c747acc5fa62a52c.tar.gz
fix #9394 by replacing `fmt` with `strutils.%` (#9417)
* fix #9394 by replacing `fmt` with normal string append

Until issue #7632 is fixed, use string append.

* use `strutils.%` instead of normal string add
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/terminal.nim8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pure/terminal.nim b/lib/pure/terminal.nim
index 2e138b27e..974dc839d 100644
--- a/lib/pure/terminal.nim
+++ b/lib/pure/terminal.nim
@@ -18,7 +18,7 @@
 
 import macros
 import strformat
-from strutils import toLowerAscii
+from strutils import toLowerAscii, `%`
 import colors, tables
 
 when defined(windows):
@@ -635,7 +635,8 @@ proc ansiForegroundColorCode*(color: Color): string =
 
 template ansiForegroundColorCode*(color: static[Color]): string =
   const rgb = extractRGB(color)
-  (static(fmt"{fgPrefix}{rgb.r};{rgb.g};{rgb.b}m"))
+  # no usage of `fmt`, see issue #7632
+  (static("$1$2;$3;$4m" % [$fgPrefix, $(rgb.r), $(rgb.g), $(rgb.b)]))
 
 proc ansiBackgroundColorCode*(color: Color): string =
   let rgb = extractRGB(color)
@@ -643,7 +644,8 @@ proc ansiBackgroundColorCode*(color: Color): string =
 
 template ansiBackgroundColorCode*(color: static[Color]): string =
   const rgb = extractRGB(color)
-  (static(fmt"{bgPrefix}{rgb.r};{rgb.g};{rgb.b}m"))
+  # no usage of `fmt`, see issue #7632
+  (static("$1$2;$3;$4m" % [$bgPrefix, $(rgb.r), $(rgb.g), $(rgb.b)]))
 
 proc setForegroundColor*(f: File, color: Color) =
   ## Sets the terminal's foreground true color.