Recreation of the Lua virtual machine
It is possible to “recreate” the Lua virtual machine (lua_State), used by the plugin, i.e: to close the current one and create a new one.
- In order to do that the global variable
RecreateLuaStateshould be assigned a true value. - The analysis of
RecreateLuaStateand the virtual machine recreation are conducted in theOpenWplugin’s exported function, just before returning control to Far Manager. - Prior to the virtual machine recreation the
LF_ExitFARfunction is called. - After the virtual machine is recreated all actions that normally occur
when Far Manager loads a LuaFAR plugin are conducted, including running
the plugin’s “starting” Lua script (which in this case receives
trueas an argument). - After the virtual machine is recreated the global variable
IsLuaStateRecreatedis set to true.