Bug 106574 - [KeyBindings] registry: General/Keys setting not saved or not restored
Summary: [KeyBindings] registry: General/Keys setting not saved or not restored
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Douglas Pollock CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-09 18:35 EDT by Don Koch CLA Friend
Modified: 2005-09-26 13:54 EDT (History)
0 users

See Also:


Attachments
org.eclipse.ui.workbench.prefs file (5.02 KB, text/plain)
2005-08-10 13:00 EDT, Don Koch CLA Friend
no flags Details
Patch to "org.eclipse.jface" (2.14 KB, patch)
2005-08-12 14:51 EDT, Douglas Pollock CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Koch CLA Friend 2005-08-09 18:35:36 EDT
Using the emacs key settings for editing.  The standard settings has CTRL+E set
to "Window/Open Editor Drop Down" which Emacs uses for "End of Line" when
editting text.  The default when editing text is the editor drop down action.

I go to Preferences/General/Keys and edit the "Window/Open Editor Drop Down"
entry and Remove the editor drop down entry for CTRL+E (leaving the alternate
entry of "CTRL+X B" for this action) and hit Apply and OK and everything works
as expected.  However, on quiting and restarting, the "Window/Open Editor Drop
Down" binding is back.

I thought that this might be related to bug 86750, but using the -data option
gave the same results; so, I'm not sure if it's the case that it's not being
saved or it's not being restored.
Comment 1 Douglas Pollock CLA Friend 2005-08-10 11:07:58 EDT
Okay, I'm not entirely clear as to your set-up.  You are using the "Emacs" 
scheme rather than the "Default" scheme?  In this case, there is no "Ctrl+E" 
binding for "Open Editor Drop Down" ... there is only "Ctrl+X B". 
 
Could you perhaps attach your 
"<workspace>/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs" 
file? 
 
Comment 2 Don Koch CLA Friend 2005-08-10 13:00:25 EDT
Created attachment 25982 [details]
org.eclipse.ui.workbench.prefs file

I note that there are two entries for CTRL+E: one for
contextId\="org.eclipse.ui.textEditorScope" and one for
contextId\="org.eclipse.ui.contexts.window".
Comment 3 Douglas Pollock CLA Friend 2005-08-10 13:19:17 EDT
You're right. 
 
    <keyBinding 
        contextId="org.eclipse.ui.textEditorScope" 
        keyConfigurationId="org.eclipse.ui.emacsAcceleratorConfiguration" 
        keySequence="CTRL+E"/> 
    <keyBinding 
        contextId="org.eclipse.ui.contexts.window" 
        keyConfigurationId="org.eclipse.ui.emacsAcceleratorConfiguration" 
        keySequence="CTRL+E"/> 
 
Which means that "Ctrl+E" is being unbound in both the global and text editor 
scope.  So, what does the preferences file look like after you hit "OK" and 
everything works? 
 
Comment 4 Don Koch CLA Friend 2005-08-10 13:25:45 EDT
(In reply to comment #3)
> You're right.
 
> Which means that "Ctrl+E" is being unbound in both the global and text editor 
> scope.  So, what does the preferences file look like after you hit "OK" and 
> everything works? 

That was it.  The time stamp changed; so, the file was written out, but it
never deletes the window setting.

Comment 5 Douglas Pollock CLA Friend 2005-08-12 14:16:58 EDT
Okay, I'm not sure how you got your preferences file into this state.  I can't 
seem to get my preference file to look like yours.  But, if I just copy your 
preference file, then I end up in the bad state you describe. 
 
Comment 6 Douglas Pollock CLA Friend 2005-08-12 14:34:35 EDT
Okay, I think I understand what is going on.  The problem is that there are  
two unbindings.  In BindingManager.removeDeletions(), it doesn't defend  
against the duplicate case.  It just clobbers a value in a map:  
  
    deletions.put(binding.getTriggerSequence(), binding);  
  
So this means that if the second deletion read doesn't match the context, then 
no real deletion happens.  This is bad.  In more complex context hierarchies, 
there could even be legitimate uses of multiple deletion markers for the same 
binding. 
 
I think probably what happened here is that the CTRL+E was removed from the 
"Go to End of Line" command, and also from the "Open Editor Drop-Down".  This 
ended up with two deletion markers, which then just confused BindingManager. 
 
Comment 7 Douglas Pollock CLA Friend 2005-08-12 14:51:21 EDT
Created attachment 26062 [details]
Patch to "org.eclipse.jface"

Okay, I believe this patch fixes this problem.	I'm going to commit it to CVS,
and it should start appearing in nightly builds -- starting tonight.  Could you
either try the patch or try N20050813-0010 or I20050816-0800?
Comment 8 Douglas Pollock CLA Friend 2005-08-12 15:08:05 EDT
Marking as FIXED.  Please re-open if this doesn't work for you.... 
Comment 9 Douglas Pollock CLA Friend 2005-08-23 15:52:40 EDT
I've fixed this on the R3_1_maintenance stream as well, so it will appear in 
3.1.1. 
Comment 10 Douglas Pollock CLA Friend 2005-09-21 15:34:57 EDT
The fix for this bug contained a bug itself.  See Bug 109011. 
Comment 11 Douglas Pollock CLA Friend 2005-09-26 13:54:48 EDT
Verified that "Ctrl+E" does nothing with the provided prefs file in both 3.1.1 
RC2 and 3.2 M2.  GTK+ 2.6.8.