diff options
author | Hans Hagen <pragma@wxs.nl> | 2020-07-27 17:00:33 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2020-07-27 17:00:33 +0200 |
commit | 58f82fce8b1f0aa48e3c1acbeed15dee999f51b9 (patch) | |
tree | 23d4c91654c6cb88343d763d877dceaea2e6dd0a /tex/context/base/mkiv/spac-par.lmt | |
parent | 07ac7b09a67d45e2dc971efc584f7f9ae7207669 (diff) | |
download | context-58f82fce8b1f0aa48e3c1acbeed15dee999f51b9.tar.gz |
2020-07-27 16:24:00
Diffstat (limited to 'tex/context/base/mkiv/spac-par.lmt')
-rw-r--r-- | tex/context/base/mkiv/spac-par.lmt | 15 |
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 } |