From bb556473635a3aa4f205cb3afa37c0a7d304c487 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 29 Sep 2020 23:54:57 +0200 Subject: [PATCH] process_see_reference: look for name.s before functions (#257) The `@see` reference for an item like the following might point to itself, although this is in `@module tag` and there is `tag.master_width_factor` also. ``` --- The default master width factor -- -- @beautiful beautiful.master_width_factor -- @param number (default: 0.5) -- @see master_width_factor -- @see gap ``` https://github.com/awesomeWM/awesome/blob/548b15e883836a2f784a4b163b097c3f523a68e0/lib/awful/tag.lua#L564-L569 This patch makes it look for the absolute reference using the module name first. --- ldoc/doc.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index 97e1ff4..aa28377 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -1180,6 +1180,10 @@ function Module:process_see_reference (s,modules,istype) end mod_ref = modules.by_name[self.package..'.'..s] if ismod(mod_ref) then return reference(s, mod_ref,nil) end + + fun_ref = self.items.by_name[self.name..'.'..s] + if fun_ref then return reference(self.name..'.'..s,self,fun_ref) end + fun_ref = self:get_fun_ref(s) if fun_ref then return reference(s,self,fun_ref) else