Re: Reset languagae modules(was: API Changes)

From: mitchell <mforal.n....at.gmail.com>
Date: Sat, 19 Jun 2010 12:26:53 -0400

Robert,

> From: Robert <ro....at.web.de>
> Date: Sat, Jun 19, 2010 at 8:57 AM
>
> Thanks - now I understand why it sometimes worked for me and sometimes not :-)
> The refocusing doesn't seem to work, as a workaround I could edit the
> cpp module, go back to the c-file that made me want to edit the
> language module, and then reset the Lua state.
> To able to do the reset in the language module file I added the
> following to my init.lua:
>
> if RESETTING then
>  events.connect('buffer_after_switch', function ()
>    local lang = buffer._lexer or false
>    if lang and not package.loaded[lang] then
>      buffer:set_lexer(lang)
>    end
>  end)
> end
>
> I added the extra check for "lang" to prevent "hanging" Textadept when
> creating a new buffer after a reset.
>
> Would you consider adding this (or something similar) to
> mime_types.lua? It would make developing language modules a lot
> easier.

Does the attached patch have the desired effect?

Mitchell

>
> Robert
>
> --
> You received this message because you are subscribed to the Google
> Groups "textadept" group.
> To post to this group, send email to textadept.at.googlegroups.com.
> To unsubscribe from this group, send email to
> textadept+unsubscribe.at.googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/textadept?hl=en.
>

Received on Sat 19 Jun 2010 - 12:26:53 EDT

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