Re: API Changes

From: Robert <ro....at.web.de>
Date: Mon, 14 Jun 2010 16:37:03 +0200

Mitchell,

> But didn't you originally suggest to have user keys.lua? Is that not a
> good idea anymore?
I did and I am sorry! Auto-loaded user dofiles are evil. See my other
post on the Lua rocks thread.
Back then you couldn't simply replace ext/key_commands without
re-requiring it and adding to your init.lua wasn't as easy as it will
be with a
require 'textadept'.

>> core/events.lua: How about adding a function for removing an event handler with
>> defaulting to removing the first one:
>> function disconnect(event, index)
>>   local plural = event..'s'
>>   local handlers = events[plural]
>>   if index then
>>     table.remove(handlers, index)
>>   else
>>     table.remove(handlers, 1)
>>   end
>> end
>
> What would be a use case? As it is, there is no way to check if a
> particular handler is at a particular index.

I use
table.remove(textadept.events['keypresss'], 1)
in my rectangular selection and enclosing functions.

Robert
Received on Mon 14 Jun 2010 - 10:37:03 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:47:46 EST