diff options
Diffstat (limited to 'tex/context/base/strc-reg.lua')
-rw-r--r-- | tex/context/base/strc-reg.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tex/context/base/strc-reg.lua b/tex/context/base/strc-reg.lua index ac0426504..721d4300b 100644 --- a/tex/context/base/strc-reg.lua +++ b/tex/context/base/strc-reg.lua @@ -22,6 +22,8 @@ local sections = structure.sections local documents = structure.documents local pages = structure.pages +local matching_till_depth, number_at_depth = sections.matching_till_depth, sections.number_at_depth + -- some day we will share registers and lists (although there are some conceptual -- differences in the application of keywords) @@ -122,8 +124,10 @@ local function filter_collected(names,criterium,number,collected,prevmode) else -- sectionname, number -- beware, this works ok for registers local depth = sections.getlevel(criterium) - local number = tonumber(number) or sections.number_at_depth(depth) or 0 - detail = format("depth: %s, number: %s, numbers: %s",depth,number,concat(sections.numbers(),".",1,depth)) + local number = tonumber(number) or number_at_depth(depth) or 0 + if trace_registers then + detail = format("depth: %s, number: %s, numbers: %s, startset: %s",depth,number,concat(sections.numbers(),".",1,depth),#collected) + end if number > 0 then for i=1,#collected do local v = collected[i] @@ -134,7 +138,7 @@ local function filter_collected(names,criterium,number,collected,prevmode) local metadata = v.metadata local cnumbers = sectionnumber.numbers if cnumbers then - if (all or hash[metadata.name or false]) and #cnumbers >= depth and sections.matching_till_depth(depth,cnumbers) then + if (all or hash[metadata.name or false]) and #cnumbers >= depth and matching_till_depth(depth,cnumbers) then result[#result+1] = v end end |