summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/spac-par.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/spac-par.lmt')
-rw-r--r--tex/context/base/mkiv/spac-par.lmt15
1 files changed, 12 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/spac-par.lmt b/tex/context/base/mkiv/spac-par.lmt
index ed5b735ec..595eabe62 100644
--- a/tex/context/base/mkiv/spac-par.lmt
+++ b/tex/context/base/mkiv/spac-par.lmt
@@ -11,6 +11,7 @@ local implement = interfaces.implement
local collected = utilities.storage.allocate()
local tobesaved = utilities.storage.allocate()
+local wrappers = { }
local jobparwrappers = {
collected = collected,
@@ -24,18 +25,26 @@ local function initializer()
collected = jobparwrappers.collected
end
-job.register('job.parwrappers.collected', tobesaved, initializer)
+local function finalizer()
+ -- nothing yet
+end
+
+job.register('job.parwrappers.collected', tobesaved, initializer, finalizer)
implement {
name = "newparwrapper",
arguments = "string",
actions = function(id)
local t = tobesaved[id]
+ local n
if t then
- t[#t+1] = 0
+ n = #t + 1
+ t[n] = 0
else
+ n = 1
tobesaved[id] = { 0 }
end
+ wrappers[id] = n
end
}
@@ -65,6 +74,6 @@ implement {
public = true,
actions = function(id)
local t = collected and collected[id]
- context(t and t[#t] or 0)
+ context(t and t[wrappers[id]] or 0)
end
}