Hi,
I have this little problem: when I'm doing autocomplete it happens
many times that I press LEFT key instead of DOWN key and I loose the
suggestion box. Then I have to type another character to show the
suggestions again because the box shows only when #charAdded is sent.
Also if I look at Eclipse, for. ex, I see that pressing LEFT/RIGHT key
I can see more/less suggestion depending on the position of the caret
which is a nice feature.
Thanks to the nature of Smalltalk I can fix this myself.
My solution is to add these methods:
SmalltalkWorkspace>>onKeyPressed: aKeyEvent
| code |
code := aKeyEvent code.
code = VK_DELETE | (code = VK_BACK) | (code = VK_LEFT) | (code =
VK_RIGHT)
ifTrue: [self startAutocompleteTimer].
^super onKeyPressed: aKeyEvent
SmalltalkSearchPresenter>>onKeyPressed: aKeyEvent
| code |
code := aKeyEvent code.
code = VK_DELETE | (code = VK_BACK) | (code = VK_LEFT) | (code =
VK_RIGHT)
ifTrue: [self startAutocompleteTimer].
^super onKeyPressed: aKeyEvent
You can see it in action here:
-
http://imageshack.us/photo/my-images/856/autocomplete1.png/ (the
caret is before K)
-
http://img542.imageshack.us/img542/2151/autocomplete2.png
My first attempt was to add a handler for #charDelete, but it seems
that ScintillaView doesn't publish/support this event.
Is there a better way to make autocomplete behave the way I want it?
Best regards,
Catalin Aramescu