[code] [textadept] Inheriting from global key mode

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

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)

keys.cmh = function()
   keys.MODE = 'TESTMODE'
   ui.statusbar_text = 'TESTMODE'
end

My usecase would be not have to redefine quit, switch view etc.

Thanks for any pointers!
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:03:26 EDT

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