summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorgenotrance <dev@genotrance.com>2020-03-03 13:52:16 -0600
committerGitHub <noreply@github.com>2020-03-03 20:52:16 +0100
commitf8175688a3b9c88b53685a35a454aeba4b2bcc5d (patch)
treeaf5e699947ee81f2dc64ef3259808377d7180840 /compiler
parente8c057fb2729b2598b8cb62ae46f85139fb480fa (diff)
downloadNim-f8175688a3b9c88b53685a35a454aeba4b2bcc5d.tar.gz
Fix docgen snippet numbering (#13507)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/docgen.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index daa3a708d..6c98266b5 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -191,10 +191,10 @@ proc newDocumentor*(filename: AbsoluteFile; cache: IdentCache; conf: ConfigRef,
   initStrTable result.types
   result.onTestSnippet =
     proc (gen: var RstGenerator; filename, cmd: string; status: int; content: string) =
+      inc(gen.id)
       var d = TDocumentor(gen)
       var outp: AbsoluteFile
       if filename.len == 0:
-        inc(d.id)
         let nameOnly = splitFile(d.filename).name
         outp = getNimcacheDir(conf) / RelativeDir(nameOnly) /
                RelativeFile(nameOnly & "_snippet_" & $d.id & ".nim")