summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-lst.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-10-17 13:20:14 +0300
committerMarius <mariausol@gmail.com>2011-10-17 13:20:14 +0300
commitfbaf4b2bb7fec1ba72bf646ff65bbb1398478c2a (patch)
tree3b6a1247a91f2d75b134dee5f6d3156980d3c75d /tex/context/base/strc-lst.lua
parent04d3fbe4239ed7d4ce05bcac837ecc4078f18347 (diff)
downloadcontext-fbaf4b2bb7fec1ba72bf646ff65bbb1398478c2a.tar.gz
beta 2011.10.17 10:36
Diffstat (limited to 'tex/context/base/strc-lst.lua')
-rw-r--r--tex/context/base/strc-lst.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/tex/context/base/strc-lst.lua b/tex/context/base/strc-lst.lua
index 5b2297f0f..41f1718a9 100644
--- a/tex/context/base/strc-lst.lua
+++ b/tex/context/base/strc-lst.lua
@@ -400,17 +400,23 @@ local function filtercollected(names, criterium, number, collected, forced, nest
detail = format("depth: %s, number: %s, numbers: %s, startset: %s",depth,number,(#t>0 and concat(t,".",1,depth)) or "?",#collected)
end
if number > 0 then
- local parent = nested and nested.parent and nested.parent.numberdata.numbers -- so local as well as nested
+ local pnumbers = nil
+ local pblock = block
+ local parent = nested and nested.parent
+ if parent then
+ pnumbers = parent.numberdata.numbers or pnumbers -- so local as well as nested
+ pblock = parent.references.block or pblock
+ end
for i=1,#collected do
local v = collected[i]
local r = v.references
- if r then -- block ?
+ if r and (not block or not r.block or pblock == r.block) then
local sectionnumber = sections.collected[r.section]
if sectionnumber then
local metadata = v.metadata
local cnumbers = sectionnumber.numbers
if cnumbers then
- if (all or names[metadata.name or false]) and #cnumbers >= depth and matchingtilldepth(depth,cnumbers,parent) then
+ if (all or names[metadata.name or false]) and #cnumbers >= depth and matchingtilldepth(depth,cnumbers,pnumbers) then
nofresult = nofresult + 1
result[nofresult] = v
end