Project: Eclipse_Platform_UI
Bug 53735 [KeyBindings] Can't override keys in "editing java context" using general context
Reported: 2004-03-04 09:02:13 | Status: verified fixed

I'm using M7. Here is what I tried to do: I did not like the switch to mapping toggle comment by default, so I decided to replace the key shortcuts for comment and uncomment. For comment, I used the old key of ctrl+/. For uncomment I used ctrl+shift+/. Comment works fine. Uncomment does not. The new keystroke shows up in workbench->keys correctly. I can assign Uncomment to its old value (ctrl+\) or a different value (shift+f4) and it works fine. One thing I did do was remove the previous association with "Add Block Comment". For ctrl+shift+/, ABC was mapped in the "Editing Java Source" context, while I was mapping Uncomment in the general context. Afer some more investigation, here is the problem. When I added the uncomment shortcut, I added it in the "General" context. So I had two assignments for ctrl+shift+/. 1. General - Uncomment 2. Editing Java Source - Add Block Comment So I selected the Add Block Comment one and pressed the "Remove" button. Now I still have the 2 lines, but the "Uncomment" line has a plus beside it and the "ABC" line has a minus beside it (and says unassigned). So my guess is that the key shortcut lookup gets stuck at the "Editing Java Source" context because of the Unassigned key. If I add ctrl+shift+/ as the keystroke for Uncomment at the "Editing Java Source" context level, then the keymapping works.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/KeySequenceBindingNode.java