diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-07-27 19:52:30 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-07-27 19:52:30 +0200 |
commit | df12f144a2cb09cec29a95df26bdfc5ccad58aff (patch) | |
tree | f25cb74e040f21e898e270c1299899b51b34bba7 /tex/context/base/mkiv/typo-inj.lua | |
parent | c73351bc5e590d5a7ebd2b0f13f895a447d25794 (diff) | |
download | context-df12f144a2cb09cec29a95df26bdfc5ccad58aff.tar.gz |
2021-07-27 19:27:00
Diffstat (limited to 'tex/context/base/mkiv/typo-inj.lua')
-rw-r--r-- | tex/context/base/mkiv/typo-inj.lua | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/typo-inj.lua b/tex/context/base/mkiv/typo-inj.lua index 44b6c0a14..ef344ec4b 100644 --- a/tex/context/base/mkiv/typo-inj.lua +++ b/tex/context/base/mkiv/typo-inj.lua @@ -41,26 +41,45 @@ function injectors.reset(name) list[name] = nil end +local function activate(injector,name) + if not injector.active then + ctx_doactivateinjector(name) + injector.active = true + if showall then + -- in case we already enabled tracing + injector.show = true + end + end +end + function injectors.set(name,numbers,command) local injector = list[name] - local actions = injector.actions - local places = settings_to_array(numbers) + local actions = injector.actions + local places = settings_to_array(numbers) for i=1,#places do actions[tonumber(places[i])] = command end - if not injector.active then - ctx_doactivateinjector(name) - injector.active = true - end + -- not: injector.show = true + activate(injector,name) end function injectors.show(name) if not name or name == "" then showall = true + local names = settings_to_array(name) + for name, injector in next, list do + injector.show = true + activate(injector,name) + end else - local list = settings_to_array(name) - for i=1,#list do - list[list[i]].show = true + local names = settings_to_array(name) + for i=1,#names do + local name = names[i] + local injector = list[name] + if injector then + injector.show = true + activate(injector,name) + end end end end |