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

From: Chris Emerson <c-ta.att.mail.nosreme.org>
Date: Tue, 20 May 2014 12:09:00 +0100

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 })

Chris

-- 
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:09:00 EDT

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