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

Bug 370257

Summary: Rebinding Ctrl+j is inconsistent
Product: [Eclipse Project] Platform Reporter: Alexander Glass <alexander.glass>
Component: DebugAssignee: Platform-Debug-Inbox <platform-debug-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Glass CLA 2012-01-31 13:32:44 EST
Build Identifier: M20110909-1335

I have noticed a problem with rebinding the Ctrl+J shortcut on windows using different PCs and different versions of Eclipse 3.7.  By default Ctrl+J is bound to incremental find.  If you unbind this key, pressing ctrl+j inserts a line feed.  If you try and rebind the key to another action sometimes it rebinds properly and sometimes it does not.  What seems to happen after a certain period of time is the binding goes back to inserting line feeds.  If you restore defaults on keybindings Ctrl+J properply binds to incremental find.  This is quite frustrating as I like to have Ctrl+J bound to "run j-unit test".

Reproducible: Always

Steps to Reproduce:
1 Unbind Ctrl+J
2 Rebind Ctrl+J
3 Press Ctrl+J in text editor
4 Observe line feed inserted

Or 

1Unbind Ctrl+J
2 Press Ctrl+J in text editor
3 Observe line feed inserted
Comment 1 Dani Megert CLA 2012-02-01 03:33:37 EST
> If you unbind this key, pressing ctrl+j inserts a line feed. 
>
> 1Unbind Ctrl+J
> 2 Press Ctrl+J in text editor
> 3 Observe line feed inserted

That is the correct behavior: if no key binding is set, then it depends whether the the OS has bound this command. Under Windows most native editors do a line feed on Ctrl+J.

> 1 Unbind Ctrl+J
> 2 Rebind Ctrl+J
> 3 Press Ctrl+J in text editor
> 4 Observe line feed inserted

This is not what I see. If I rebind again to 'Incremental Find' or 'Open Type', it works as expected.


Having said that, I know what problem you run into. It's not specific to Ctrl+J but to the 'Run JUnit Test' command. This is captured by bug 218881.


Possible workaround: have the Debug views open in your workbench. This will ensure that Debug gets loaded and hence your shortcut will work. I know it's not perfect, but it works.

*** This bug has been marked as a duplicate of bug 218881 ***