Re: [code] [textadept] Inheriting from global key mode

From: Robert Gieseke <rob.g.att.web.de>
Date: Tue, 20 May 2014 13:45:53 +0200

Am 20/05/14 13:09, schrieb Chris Emerson:
> Hi,
>
> On Tue, May 20, 2014 at 01:03:26PM +0200, Robert Gieseke wrote:
>> Hi,
>>
>> is there a way to have a key mode 'inherit' from the global key mode?
>>
>> The following setting of a __index metatable does not work:
>>
>> keys.TESTMODE = {
>> ['esc'] = function()
>> keys.MODE = nil
>> ui.statusbar_text = 'default keys'
>> end
>> }
>>
>> setmetatable(keys.TESTMODE, keys)
>
> I think this should be:
>
> semetatable(keys.TESTMODE, { __index=keys })

Thanks, that was a copy-and-not-quite-paste error -- now it works. I'm
trying to migrate Textredux to use keys.MODE but the problem seems to
lie elsewhere

Off to investigate,
Robert

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 20 May 2014 - 07:45:53 EDT

This archive was generated by hypermail 2.2.0 : Wed 21 May 2014 - 06:35:59 EDT