Re: API Changes

From: mitchell <mforal.n....at.gmail.com>
Date: Fri, 18 Jun 2010 08:58:36 -0700 (PDT)

Robert,

On Jun 18, 11:09 am, Robert <ro....at.web.de> wrote:
> Hi Mitchell,
>
> looking throught the new API I saw this in ._G.luadoc:
>
> -- Resets the Lua state by reloading all init scripts.
> -- Language-specific modules for opened files are NOT reloaded. Re-opening the
> -- files that use them will reload those modules.
> -- This function is useful for modifying init scripts (such as keys.lua) on the
> -- fly without having to restart Textadept.
>
> I just tested this and it is reloading the module. I think, you had a
> fix for the language modules a while ago.
> Speaking of the resets.
> I have
> keys['f9'] = { function()
>   buffer:save()
>   gui.statusbar_text = "Reset."
>   _G.reset()
> end }
> in my init.lua.
> Maybe adding the statusbar change to Textadept core would be helpful
> for others as well, sometimes a processed file is failing silently.

If you have a lua file open and focused and then reset the lua state,
the lua module is reloaded since the file is open. But if you have a
cpp file open in another buffer, resetting the lua state will not
reload the cpp module until that buffer is refocused or another cpp
file loaded.

>
> So maybe in core/init.lua:
> events.connect('reset_after', function() gui.statusbar_text = 'Reset.' end)

I'll do this later today. It's a good suggestion.

Mitchell

>
> If not, I'll put it on the wiki... :-)
>
Received on Fri 18 Jun 2010 - 11:58:36 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:48:05 EST