Re: [textadept] Textadept 3.7 beta

From: mitchell <c....at.caladbolg.net>
Date: Thu, 3 Feb 2011 10:47:31 -0500 (Eastern Standard Time)

Hi Robert,

> On Tue, Feb 1, 2011 at 11:46 PM, mitchell <c....at.caladbolg.net> wrote:
>>
>> �� * Added Adeptsense, a smarter form of autocompletion for programming languages.
>
> Really cool, that the apidocs work now for all possibilities of for example
> open()
> It should be noted that clicking *anywhere* on the call tip toggles it
> :-) At first I clicked the arrows...
> I experimented with adapting the adeptsense to allow�toggling with the
> keyboard, along the lines of
>
> local keypress_event_id = events.connect('keypress',
> ��� function(code, shift, control, alt)
> ����� if buffer:call_tip_active() then
> --������� if control and string.char(code) == 'n' then
> ������� if control and keys.KEYSYMS[code] == 'up' then
> ��������� apidocs.pos = apidocs.pos + (position == 1 and -1 or 1)
> ��������� if apidocs.pos > #apidocs then apidocs.pos = 1 end
> ��������� if apidocs.pos < 1 then apidocs.pos = #apidocs end
> ��������� buffer:call_tip_show(buffer.current_pos, apidocs[apidocs.pos])
> ��������� return true
> ������� end
> ����� end
> ��� end, 1)
> � _G.timeout(1, function()
> ��� if buffer:call_tip_active() then return true end
> ��� events.disconnect('call_tip_click', event_id)
> ��� events.disconnect('keypress', keypress_event_id)
> � end)
>
> It appears that simply using 'up' and 'down' is not possible because
> Scintilla cancels the
> call tip on anything that is "not compatible with editing the argument
> list of a function."
>
> Would you accept a proper patch, if yes, which keys should we be using?
> ctrl-n/p, alt-up/down, ctrl-up/down?

There is a simpler way:

keys['up'] = { function()
   if buffer:call_tip_active() then
     events.emit('call_tip_click', 1)
     return true
   end
end }
keys['down'] = { function()
   if buffer:call_tip_active() then
     events.emit('call_tip_click', 2)
     return true
   end
end }

mitchell
Received on Thu 03 Feb 2011 - 10:47:31 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:59:31 EST