From 8de6c79493d1ddf547cd648af0661c4e4fa3403c Mon Sep 17 00:00:00 2001 From: Steve Donovan Date: Thu, 13 Oct 2016 11:00:05 +0200 Subject: [PATCH] issue #251 avoid potential clash between built-in and custom defined kinds like sections --- ldoc/doc.lua | 4 +++- ldoc/tools.lua | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index 4bca4ab..782ff07 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -295,7 +295,9 @@ function File:finish() end item.display_name = display_name this_mod.section = item - this_mod.kinds:add_kind(display_name,display_name,nil,item) + -- the purpose of this little hack is to properly distinguish + -- between built-in kinds and any user-defined kins. + this_mod.kinds:add_kind(display_name,display_name..' ',nil,item) this_mod.sections:append(item) this_mod.sections.by_name[lookup_name:gsub('%A','_')] = item end diff --git a/ldoc/tools.lua b/ldoc/tools.lua index 947d207..c716bf4 100644 --- a/ldoc/tools.lua +++ b/ldoc/tools.lua @@ -108,7 +108,6 @@ function KindMap:add (item,items,description) local group = item[self.fieldname] -- which wd be item's type or section local kname = self.klass.types_by_tag[group] -- the kind name if not self[kname] then - -- print(kname,group,self.fieldname) self[kname] = M.type_iterator (items,self.fieldname,group) self.klass.descriptions[kname] = description end