The summary says it all.
Should Work - press right arrow when the "Configure" semi-fix is shown in the pop-up.
The problem turns out to be an interaction between the jVi keybindings and ScrollCompletionPane.installKeyBindings/ScrollCompletionPane.findEditorKeys. For now I've got a workaround.
This in not the first time there has been binding struggles. jVi also has a workaround for some stuff in CompletionImpl.
Rewording the title and cc'ing Mila, Tim and editor since the various source code credits them. Possibly this bug should go to editor?
I'm wondering if there is a way this type of thing can be restructured to avoid this issue in the future, or at least have a well defined way to deal with it when it shows up. Assuming a relatively simple design, I could probably do the work.
The goal seems to be to find the KeyStrokes associated with a particular action, for example caret-forward, and then use those keystrokes for actions in some other component. If the map of behavior,action could be discovered in the filesystem then jVi could switch in its actions while it is active.
> map of behavior,action ...
Hmm, I guess that is the action map. I guess I should be able to simple add something like:
"caret-forward" --> jViAction
directly into action map
Then, even though there is no keystroke that maps to caret-forward, ScrollCompletionPane.findEditorKeys should still do the right thing. I'll play with this and hopefully just close this bug.
I tried adding entries like
"caret-forward" --> jViAction
into the editor component's ActionMap. But this didn't work. The code in ScrollCompletionPane.findEditorKeys essentially does
which operates on BasKit's internal stuff, not necessarily the map defined in the component.
There is no way, AFAICT, to get these entries into the Kit's map.
StorageFilter<Collection<KeyStroke>, MultiKeyBinding> simply doesn't support it.
If findEditorKeys did the following instead
then it would work.
I guess the first question is whether findEditorKeys can safely be modified to use the component's ActionMap rather than the one from BaseKit? The question applies to both ScrollCompletionPane and CompletionImpl
Thanks for the investigations. I tried to use component.getActionMap().get(editorActionName)
instead of kit.getActionByName and both the hint popup and code completion seem to work OK. So unless someone anticipates some problems, I am going to commit the change.
IMO, using the component's map should be ok.
Ernie, is there something more that needs to be done in NetBeans? Thanks.
> more that needs to be done in NetBeans?
Not that I'm aware of... I've added the changes to jVi.
Integrated into 'main-golden', will be available in build *201004131450* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jan Lahoda <firstname.lastname@example.org>
Log: #183675: getting shortcuts for actions using "component.getActionMap().get(editorActionName)".
So, this can be marked as fixed, right? Thanks.