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

Bug 422622

Summary: Plugin key bindings should be specific to content type
Product: [ECD] Orion Reporter: Jon Johnson <jonjonsonjr>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: lmsurpre, Silenio_Quarti
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
All three formatting shortcuts show up instead of just the html one none

Description Jon Johnson CLA 2013-11-26 18:42:20 EST
If a plugin is registered with a particular content type, should its key binding only apply to that content type?

I have plugins installed that have disjoint content types but overlapping key bindings. One of the plugins is overriding all the other key bindings for all content types, even though it is registered to a different content type.
Comment 1 Jon Johnson CLA 2013-11-26 19:10:40 EST
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=422624 for why this is necessary.

I have multiple plugins to reformat text, and I'd like them all to share the same key binding but operate on different content types.
Comment 2 Silenio Quarti CLA 2013-11-27 09:57:35 EST

*** This bug has been marked as a duplicate of bug 422563 ***
Comment 3 Silenio Quarti CLA 2013-11-27 09:58:17 EST
Please try the latest code. This was fixed yesterday.
Comment 4 Lee Surprenant CLA 2014-01-28 15:37:06 EST
Silenio, I installed Jon's plugin from https://github.com/jonjonsonjr/beautify, tried it with a fresh clone of org.eclipse.orion.client, and I noticed that all three format options now show up in the bindings list (see attachment).

Is that expected?  Shouldn't it be restricted to just the bindings that are valid for the currently open content type?

Is he doing something wrong when he registers them?  Should we reopen this bug?


I also noticed that, on this fresh checkout from master, this keybinding (Alt + F) doesn't work for me on my Mac any more.  This is also true for the 'original' jsbeautify from https://orion-plugins.googlecode.com/git/0.5/plugins/beautify/jsbeautify.html.  Instead, it just adds a 'ƒ' character.
Is this part of the code in flux?  Should I open a separate bug for it?
Comment 5 Lee Surprenant CLA 2014-01-28 15:38:51 EST
Created attachment 239404 [details]
All three formatting shortcuts show up instead of just the html one

Note that only the proper button is shown, but all three shortcuts are still listed.  Clicking on the Format HTML option does work as expected.
Comment 6 Silenio Quarti CLA 2014-02-03 12:38:56 EST
Bug#422563 was about the fact that all the key bindings were active independent of the content type of the opened resource.

The key assist panel has always shown all the registered key bindings (not only the ones active to the moment).  I reopened the bug to investigate whether this was done by accident or it was the indented behavior.  All can see people that would like to see all the key bindings registered.

The fact that Alt+F does not work on the Mac is not a bug.  That key combination generates a character (most keys with the alt modifier do on Mac) and it should not be used as a shortcut on editors.
Comment 7 John Arthorne CLA 2015-05-05 14:43:08 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html