Re: [code] [textadept] Dynamic keychains

From: Mitchell <m.att.foicica.com>
Date: Wed, 18 Dec 2013 00:10:59 -0500 (EST)

Hi Chris,

On Sun, 1 Dec 2013, Chris Emerson wrote:

> [snip]
>
>>> Alternatively, using the table form you could define a special parameter
>>> which is replaced by the key chain (just like run_command swaps in the
>>> current buffer/view).
>>
>> I think the only real solution is to make 'keychain' accessible
>> (e.g. global). This would require a read-only proxy. Would this work
>> for you? e.g.
>>
>> keys['w'] = function()
>> local repetitions = get_repetitions(keys.keychain)
>> local action = get_action(keys.keychain)
>> ...
>> keys.keychain[1] = nil -- throws an error
>> end
>
> That would work. It's a shame Lua hasn't got something like keyword
> parameters to avoid the global variable though!

This is in hg now.

Cheers,
Mitchell

-- 
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 Wed 18 Dec 2013 - 00:10:59 EST

This archive was generated by hypermail 2.2.0 : Wed 18 Dec 2013 - 06:29:55 EST