[Geany-devel] Calltip and autocomplete interaction

Enrico Tröger enrico.troeger at xxxxx
Fri Jul 24 10:09:17 UTC 2009


On Fri, 24 Jul 2009 12:42:42 +1000, Lex wrote:

>Hi Guys,
>
>When typing a function call, the calltip is shown when the '(' is
>typed.  It is then replaced by autocomplete suggestions as the
>parameter is typed.  If the autocomplete is accepted then the calltip
>is re-displayed, but if the autocomplete is not accepted, such as by
>typing ',' then the tooltip is not re-displayed, very annoying.  I
>know I can re-display it manually by twisting my fingers into a knot
>;-) but automatic would be better.

You know you can re-configure the keybinding for showing calltips :)


>AFAICT the editor.c code intends to re-display it but I can't see why
>it doesn't work in this case.

Yeah :(.
It's in src/editor.c at handling the SCN_AUTOCCANCELLED notification.
I think the problem was that we passed a reference to the
SCNotification struct to the idle function but at the time that
idle function was called, the SCNotification struct was not valid
anymore because most likely other Scintilla messages have been arrived
and so the struct contained other or invalid information for this
operation. So, in SVN r4021 I changed the code so that it caches the
necessary information (nt->lParam and nt->text) and pass the cached
information to the idle function. And it seems, now it works only with
a real idle function and not a 50ms timeout which was very ugly.

Quick testing has shown it seems to work but I'm not that sure, so
please test.

Update: while re-reading your initial report and re-testing, it still
doesn't work if you cancel the auto-completion list by typing an
invalid character (invalid in terms of a non-matching item). For this
to work, we would need to explicitly reshow the calltip also when
receiving SCN_CHARADDED. Right now, I'm not sure whether it can/should
do this unconditionally or whether we need some logic behind when to
reshow the calltip (of course, the basic condition is only reshow it
when it was shown before :D).
Anyway, reshowing the calltip after a cancelled auto-completion list
should work pretty good now when closing the list with Escape so that
we really receive a SCN_AUTOCCANCELLED message.


>Also I noticed that the manual doesn't describe symbol autocompletion
>operation and the keycodes for accept and dismiss.  It does for
>snippets, but not for symbol autocomplete.

You mean Enter/Tab to accept an item and Escape to cancel an
auto-completion list?


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20090724/127c52ea/attachment.pgp>


More information about the Devel mailing list