summary refs log tree commit diff stats
path: root/compiler/pretty.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-09-08 09:18:09 +0200
committerAraq <rumpf_a@web.de>2014-09-08 09:18:09 +0200
commitc53a27f0dc4e867701955e97b607aab2b66a0740 (patch)
tree519ce7a9527e74c4a94109fcaf81ad21be6a12f3 /compiler/pretty.nim
parent7333237be6abe3f170fe440e887ae83707fd748f (diff)
downloadNim-c53a27f0dc4e867701955e97b607aab2b66a0740.tar.gz
nimfix supports specialized '.nimfix' modules
Diffstat (limited to 'compiler/pretty.nim')
-rw-r--r--compiler/pretty.nim28
1 files changed, 14 insertions, 14 deletions
diff --git a/compiler/pretty.nim b/compiler/pretty.nim
index b7265b946..436181bbc 100644
--- a/compiler/pretty.nim
+++ b/compiler/pretty.nim
@@ -31,20 +31,20 @@ type
 proc overwriteFiles*() =
   let doStrip = options.getConfigVar("pretty.strip").normalize == "on"
   for i in 0 .. high(gSourceFiles):
-    if not gSourceFiles[i].dirty: continue
-    let newFile = if gOverWrite: gSourceFiles[i].fullpath
-                  else: gSourceFiles[i].fullpath.changeFileExt(".pretty.nim")
-    try:
-      var f = open(newFile, fmWrite)
-      for line in gSourceFiles[i].lines:
-        if doStrip:
-          f.write line.strip(leading = false, trailing = true)
-        else:
-          f.write line
-        f.write("\L")
-      f.close
-    except IOError:
-      rawMessage(errCannotOpenFile, newFile)
+    if gSourceFiles[i].dirty and not gSourceFiles[i].isNimfixFile:
+      let newFile = if gOverWrite: gSourceFiles[i].fullpath
+                    else: gSourceFiles[i].fullpath.changeFileExt(".pretty.nim")
+      try:
+        var f = open(newFile, fmWrite)
+        for line in gSourceFiles[i].lines:
+          if doStrip:
+            f.write line.strip(leading = false, trailing = true)
+          else:
+            f.write line
+          f.write("\L")
+        f.close
+      except IOError:
+        rawMessage(errCannotOpenFile, newFile)
 
 proc `=~`(s: string, a: openArray[string]): bool =
   for x in a: