From 59aad1f0447dffae92e97735d23ad824cbbbcf0a Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 30 May 2007 10:54:35 +0000 Subject: [PATCH] Added a bit to the template environment so all globals can now be called. (tenv._G refers to the regular global environment, so it's not safe from mangling, but that shouldn't matter either way. It allows much more freedom in writing templates.) Originally committed to SVN as r1200. --- automation/autoload/kara-templater.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/automation/autoload/kara-templater.lua b/automation/autoload/kara-templater.lua index c854746ad..1585fc6c2 100644 --- a/automation/autoload/kara-templater.lua +++ b/automation/autoload/kara-templater.lua @@ -248,8 +248,10 @@ function apply_templates(meta, styles, subs, templates) local tenv = { -- put in some standard libs string = string, - math = math + math = math, + _G = _G } + tenv.tenv = tenv -- run all run-once code snippets for k, t in pairs(templates.once) do