The next documentation describes the operation of _AUTO_RELOAD_DEBUG:
tool: globals
When working with Renoise’s Scripting Editor, saving a script will automatically reload the tool that belongs to the file. This way you can simply change your files and immediately see/test the changes within Renoise.
When working with an external text editor, you can enable the following debug
option somewhere in the tool’s main.lua file:
_AUTO_RELOAD_DEBUG = function()
-- do tests like showing a dialog, prompts whatever, or simply do nothing
end
Now, as soon as you save your script outside of Renoise, and then focus Renoise
again (alt-tab to Renoise, for example), your script will instantly get reloaded
and the notifier is called.
If you don’t need a notifier function to be called each time the script reloads,
you can also simply set _AUTO_RELOAD_DEBUG = true to enable the automatic
reloading of your tool.
@type (true|fun())?
_AUTO_RELOAD_DEBUG = nil;
This means that all local or global in memory is destroyed, and the entire tool is subsequently reread.
-
How would it be possible to preserve a variable (or table) that survives _AUTO_RELOAD_DEBUG and therefore we can access that value later?
-
On the other hand, is there a function that allows us to completely restart a tool whenever we want, allowing us to preserve whatever we want somewhere (ideally temporarily in memory), be it a variable or a table?
The idea would be to be able to save a variable (or table) without having to create a file outside of the tool’s root folder.
For example, here’s a tricky thing I came up with: Song comments are permanent and can be manipulated from the API, without affecting song reloads of the tools (it is a data saved inside the song). I think it would be very useful to have a safe place where we could store permanent external data, outside of the tool’s root folder, to later retrieve those desired states. At least let them survive the open Renoise session.