Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 23008

Summary: [content assist][key bindings] Emacs bindings not working on content assist and quick fix
Product: [Eclipse Project] Platform Reporter: Marius Kotsbak <marius>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: andreis, daniel_megert, erich_gamma, gunnar, hovan, kurtg, nathansobo, stori
Version: 2.0   
Target Milestone: 3.4 M4   
Hardware: All   
OS: All   
Whiteboard:

Description Marius Kotsbak CLA 2002-08-29 17:32:37 EDT
The choice in the popup with alternatives is not possible to move with emacs
keys ctrl-p/n, just the down/up arrow keys. This is possible in jbuilder with
emacs emulation.
Comment 1 Dani Megert CLA 2006-03-03 04:00:08 EST
*** Bug 65776 has been marked as a duplicate of this bug. ***
Comment 2 Dani Megert CLA 2006-03-03 04:01:23 EST
*** Bug 37761 has been marked as a duplicate of this bug. ***
Comment 3 Dani Megert CLA 2006-03-03 04:01:46 EST
*** Bug 130249 has been marked as a duplicate of this bug. ***
Comment 4 Dani Megert CLA 2007-05-29 07:14:50 EDT
*** Bug 140550 has been marked as a duplicate of this bug. ***
Comment 5 Dani Megert CLA 2007-05-29 07:16:03 EDT
The correct fix would be to activate a special context while content
assist is active.
Comment 6 Dani Megert CLA 2007-05-29 07:16:17 EDT
*** Bug 189610 has been marked as a duplicate of this bug. ***
Comment 7 Dani Megert CLA 2007-11-02 05:54:07 EDT
*** Bug 208474 has been marked as a duplicate of this bug. ***
Comment 8 André Søreng CLA 2007-11-02 11:19:17 EDT
On Linux there is a workaround. Since Eclipse uses SWT/GTK, you can
add the following line to your $HOME/.gtkrc-2.0 file:

gtk-key-theme-name = "Emacs"

Just press Tab first to give the dialog focus, and then use ctrl+n/p to 
navigate up and down like with the arrow keys. This should work in all
dialogs in Eclipse, not just the content assist.
Comment 9 Dani Megert CLA 2007-11-05 06:29:54 EST
>I guess this is not a JDT specific problem and needs to be fixed
>globally. E.g. the configured up/down keys should work in any kind
>of dialog/window. 
The problem here is that the proposal popup initially does not have the keyboard focus i.e. even if the active dialog would support up/down commands it would not work in this scenario until the dialog got the focus. Also, until now we never had a feature request for generic Up/Down for all list dialogs.

I see two possible ways to fix this:
1) register specific commands for (Page) Up/Down while the popup is active. This
   needs API from code assist to navigate through the list

2) add API to the content assistant to set the (Page) Up/Down key sequences
Comment 10 Dani Megert CLA 2007-11-29 12:18:42 EST
I have a question for those who want this feature: assuming you work in Eclipse Emacs mode: do you also set gtk-key-theme-name = "Emacs"?

I have the code ready that makes Ctrl+N/P work when inside the editor and I can also enable it when the popup has focus. The problem is: if
    gtk-key-theme-name = "Emacs"
is set then it will jump by two and not just one item each time.


I suggest to not touch the proposal list widget key bindings once it has focus i.e. whatever works on your platform will work in that widget but nothing else.
Comment 11 Dani Megert CLA 2007-11-30 11:02:55 EST
Added emacs support and fixed Home/End problem in HEAD.
Available in builds > N20071130-0010.
Comment 12 Marius Kotsbak CLA 2012-09-24 10:27:10 EDT
This is still not working properly. To get the emacs keys to work, I have to first press tab key (else I get navigation in the source code instead), while using arrow keys have effect on the popup list directly.
Comment 13 Marius Kotsbak CLA 2012-09-24 10:28:19 EDT
I think it could be a regression, since I think this was working properly in some earlier versions (currently using Juno release 20120614-1722).
Comment 14 Dani Megert CLA 2012-10-02 05:30:51 EDT
Please do not reopen closed bugs but instead file a new one with steps to reproduce. In your case I think you see bug 382839.
Comment 15 Marius Kotsbak CLA 2012-10-02 05:51:03 EDT
Sorry, it might be, even though the behavior is a bit different.