diff --git a/luafar/lua_share/far2/luacheck_generate.lua b/luafar/lua_share/far2/luacheck_generate.lua index 0ae4462a2..7aa1f3636 100644 --- a/luafar/lua_share/far2/luacheck_generate.lua +++ b/luafar/lua_share/far2/luacheck_generate.lua @@ -108,7 +108,6 @@ local function Generate (outname) self:Insert("\n\n") self:Insert("local luamacro = {") - self:Insert("globals = { [[MacroData]] };") self:Insert("read_globals = {") table.sort(globals_luamacro, NoCaseCmp) for _,name in ipairs(globals_luamacro) do diff --git a/luafar/manuals/macroapi_manual_linux.chm b/luafar/manuals/macroapi_manual_linux.chm index 005e08ad8..4257dac88 100644 Binary files a/luafar/manuals/macroapi_manual_linux.chm and b/luafar/manuals/macroapi_manual_linux.chm differ diff --git a/luamacro/src/api.lua b/luamacro/src/api.lua index 93ccee2aa..afe5a916e 100644 --- a/luamacro/src/api.lua +++ b/luamacro/src/api.lua @@ -675,6 +675,17 @@ function mf.printconsole(...) far.WriteConsole(text) end end + +local Persistent = {} +function mf.GetPersistent(field) + assert(type(field)=="string", "arg #1 must be a string") + local t = Persistent[field] + if t == nil then + t = {} + Persistent[field] = t + end + return t +end -------------------------------------------------------------------------------- _G.band, _G.bnot, _G.bor, _G.bxor, _G.lshift, _G.rshift = @@ -682,7 +693,5 @@ _G.band, _G.bnot, _G.bor, _G.bxor, _G.lshift, _G.rshift = _G.eval, _G.msgbox, _G.prompt = mf.eval, mf.msgbox, mf.prompt -_G.MacroData = {} -- a global table for scripts' data - mf.Keys, mf.exit, mf.print = _G.Keys, _G.exit, _G.print --------------------------------------------------------------------------------