Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322019 - The "Delete Line" key binding actually deletes 3 lines.
Summary: The "Delete Line" key binding actually deletes 3 lines.
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: Macintosh Mac OS X
: P3 major with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 338745 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-06 13:49 EDT by Missing name Mising name CLA
Modified: 2017-07-03 07:30 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name Mising name CLA 2010-08-06 13:49:58 EDT
Build Identifier: 20100617-1415

I have the keyboard shortcut Command-D bound to "Delete Line". For some reason, with the latest version of Eclipse, this actually deletes 3 lines (the current line and the 2 lines following it).

Reproducible: Always
Comment 1 Prakash Rangaraj CLA 2010-08-06 14:07:56 EDT
It works fine for me. Which editor does this happen? Does this happens on a fresh workspace too?
Comment 2 Missing name Mising name CLA 2010-08-06 17:19:31 EDT
(In reply to comment #1)
> It works fine for me. Which editor does this happen?

I have noticed it in the Java editor, but perhaps it happens in others as well.

> Does this happens on a fresh workspace too?

Yes.
Comment 3 Remy Suen CLA 2010-08-06 18:36:00 EDT
If you change the keybinding do you get the same effect?
Comment 4 Missing name Mising name CLA 2010-08-06 20:37:07 EDT
(In reply to comment #3)
> If you change the keybinding do you get the same effect?

No, if I change the key binding, everything works as expected.

What's interesting is, when I change the key binding back to Command-D, the Command-D appears three times in the "Binding:" text box. I can manually delete two of these, but obviously what is happening here is that for some strange reason Eclipse is interpreting one Command-D press as three.

I wonder why this is? Just to note, no other application seems to have this problem. For example, just to name a few applications similar to Eclipse: NetBeans, IntelliJ IDEA, jEdit. All of these applications interpret the Command-D key press properly, so this is definitely something specific to Eclipse.
Comment 5 Missing name Mising name CLA 2010-08-10 20:25:39 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > If you change the keybinding do you get the same effect?
> 
> No, if I change the key binding, everything works as expected.
> 
> What's interesting is, when I change the key binding back to Command-D, the
> Command-D appears three times in the "Binding:" text box. I can manually delete
> two of these, but obviously what is happening here is that for some strange
> reason Eclipse is interpreting one Command-D press as three.
> 
> I wonder why this is? Just to note, no other application seems to have this
> problem. For example, just to name a few applications similar to Eclipse:
> NetBeans, IntelliJ IDEA, jEdit. All of these applications interpret the
> Command-D key press properly, so this is definitely something specific to
> Eclipse.

Hi,

Are there any updates on this? I have tried once again from a fresh workspace, but the results are the same. This is such a common shortcut (in almost all applications) and I have become so used to it that this problem had rendered Eclipse too annoying for me to use.

Is there any other information I can help with to get this bug resolved?

Thank you.
Comment 6 Prakash Rangaraj CLA 2010-08-10 23:56:04 EDT
(In reply to comment #5)
> 
> Is there any other information I can help with to get this bug resolved?

   I still couldn't reproduce this one. Assigning to Platform-text.
Comment 7 Dani Megert CLA 2010-08-11 03:05:22 EDT
>Is there any other information I can help with to get this bug resolved?
Yes, please provide a step by step example including the full source you use for it and use Mac build from here:
http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/index.php

Also, which OS exactly and which VM are you using?
Comment 8 Markus Keller CLA 2010-08-11 05:55:51 EDT
(In reply to comment #4)
> What's interesting is, when I change the key binding back to Command-D, the
> Command-D appears three times in the "Binding:" text box.

That clearly shows that the problem is not in Text. Probably an SWT problem, but could also be a problem in the key bindings implementation, or a bug in a third-party plug-in.

(In reply to comment #7)
> Also, which OS exactly and which VM are you using?

Please also tell whether you use the Carbon or the Cocoa build.
Comment 9 Missing name Mising name CLA 2010-08-11 13:55:27 EDT
> (In reply to comment #7)
> > Also, which OS exactly and which VM are you using?
> 
> Please also tell whether you use the Carbon or the Cocoa build.

OS:

 Mac OS X 10.5.8

Eclipse:

 Eclipse IDE for Java Developers
 Version: Helios Release
 Build id: 20100617-1415
 File: eclipse-java-helios-macosx-cocoa-x86_64.tar.gz

Java:

 java version "1.6.0_20"
 Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-9M3165)
 Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)
Comment 10 Missing name Mising name CLA 2010-08-11 18:59:30 EDT
(In reply to comment #9)
> > (In reply to comment #7)
> > > Also, which OS exactly and which VM are you using?
> > 
> > Please also tell whether you use the Carbon or the Cocoa build.
> 
> OS:
> 
>  Mac OS X 10.5.8
> 
> Eclipse:
> 
>  Eclipse IDE for Java Developers
>  Version: Helios Release
>  Build id: 20100617-1415
>  File: eclipse-java-helios-macosx-cocoa-x86_64.tar.gz
> 
> Java:
> 
>  java version "1.6.0_20"
>  Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-9M3165)
>  Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)

Actually, the file I used to "install" eclipse is: eclipse-SDK-3.6-macosx-cocoa-x86_64.tar.gz

I have tried a fresh "install" with a fresh workspace, and I still get the problem. Could someone else try this exact same package to see if the problem can be replicated elsewhere? All the other keyboard shortcuts that I have tried seem to work fine... only Command-D seems to be interpreted 3 times per press. I really don't think this is environment-related, since NetBeans, IntelliJ IDEA, and jEdit all function properly, and running on the same JVM.

Thank you.
Comment 11 Missing name Mising name CLA 2010-08-12 00:54:01 EDT
Hi,

So I tried coding up a small SWT application to test this problem...

    final StyledText styledText = new StyledText(...);
    styledText.addVerifyKeyListener(new VerifyKeyListener() {
      @Override public void verifyKey(VerifyEvent event) {
        System.out.printf("%s ", Integer.toHexString(event.character));
      }
    });

If I run this snippet and type Command-D, the output is "0 64 64 64 ".

So it seems that SWT is the culprit here. I am using swt-3.6-cocoa-macosx-x86_64.
Comment 12 Missing name Mising name CLA 2010-08-12 09:49:35 EDT
(In reply to comment #11)
> Hi,
> 
> So I tried coding up a small SWT application to test this problem...
> 
>     final StyledText styledText = new StyledText(...);
>     styledText.addVerifyKeyListener(new VerifyKeyListener() {
>       @Override public void verifyKey(VerifyEvent event) {
>         System.out.printf("%s ", Integer.toHexString(event.character));
>       }
>     });
> 
> If I run this snippet and type Command-D, the output is "0 64 64 64 ".
> 
> So it seems that SWT is the culprit here. I am using
> swt-3.6-cocoa-macosx-x86_64.

I have a hunch that maybe someone could investigate? Perhaps the 64-bit version started as the 32-bit version, and was then modified as needed. Perhaps during this modification, someone did a search for "32" and replaced it with "64". In this case, since 64 is hex for 'd', perhaps multiple code branches end up reacting to 'd' while the Command key is pressed, hence it is repeated multiple times.

It's just a hunch without looking at the code. Could someone more familiar with the code see if this is possibly the case? Also, as a quick smoke screen, perhaps someone could test the above snippet on the 32-bit version of SWT? I cannot run it since I only have the 64-bit JVM.

Thank you.
Comment 13 Scott Kovatch CLA 2010-08-12 11:34:59 EDT
(In reply to comment #10)
> (In reply to comment #9)
> > 
> > OS:
> > 
> >  Mac OS X 10.5.8
> > 
> > Eclipse:
> > 
> >  Eclipse IDE for Java Developers
> >  Version: Helios Release
> >  Build id: 20100617-1415
> >  File: eclipse-java-helios-macosx-cocoa-x86_64.tar.gz

I am on 10.6, but I don't see this behavior in a stock 3.6 release of Eclipse, in either 32- or 64-bit Cocoa. If I hold down command-D I eventually see the 64's repeat, 3 at a time, so there is potentially a bug there.

What are your key repeat settings? See System Preferences -> Keyboard. Which keyboard layout are you using?
Comment 14 Missing name Mising name CLA 2010-08-12 17:39:30 EDT
(In reply to comment #13)
> I am on 10.6, but I don't see this behavior in a stock 3.6 release of Eclipse,
> in either 32- or 64-bit Cocoa. If I hold down command-D I eventually see the
> 64's repeat, 3 at a time, so there is potentially a bug there.
> 
> What are your key repeat settings? See System Preferences -> Keyboard. Which
> keyboard layout are you using?

I'll check this later today. But if the problem were a result of these settings, wouldn't other applications have the same issue? No other applications seem to be having this problem, including similar Java applications such as NetBeans, IntelliJ IDEA, jEdit, etc.
Comment 15 Scott Kovatch CLA 2010-08-23 13:05:25 EDT
(In reply to comment #14)

> I'll check this later today. But if the problem were a result of these
> settings, wouldn't other applications have the same issue? No other
> applications seem to be having this problem, including similar Java
> applications such as NetBeans, IntelliJ IDEA, jEdit, etc.

No, not necessarily. It sounds like this is happening because we're generating multiple SWT.KeyDown events. I'm just trying to find out if we're not handling the key-repeat case properly.
Comment 16 Missing name Mising name CLA 2010-08-23 21:22:32 EDT
(In reply to comment #14)
> > What are your key repeat settings? See System Preferences -> Keyboard. Which
> > keyboard layout are you using?

I checked my key repeat settings, and they are nothing out of the ordinary. I tried adjusting them to both the min and max values, but this didn't have any effect on the problem... no matter what, Eclipse/SWT give me three key presses instead of one for Command-D.

Any other ideas?

Thanks.
Comment 17 Scott Kovatch CLA 2010-08-27 13:51:28 EDT
(In reply to comment #16)

> I checked my key repeat settings, and they are nothing out of the ordinary. I
> tried adjusting them to both the min and max values, but this didn't have any
> effect on the problem... no matter what, Eclipse/SWT give me three key presses
> instead of one for Command-D.

Is it just command-D that triggers this? Does your test case have the same result for all command key pairs?
Comment 18 Scott Kovatch CLA 2010-08-27 14:52:23 EDT
(In reply to comment #17)
> (In reply to comment #16)
>
> Is it just command-D that triggers this? Does your test case have the same
> result for all command key pairs?

Oh, I see you tried changing the binding in comment #4, but does your test case do the right thing for another command key pair?
Comment 19 Missing name Mising name CLA 2010-08-27 21:09:54 EDT
(In reply to comment #18)
> (In reply to comment #17)
> > (In reply to comment #16)
> >
> > Is it just command-D that triggers this? Does your test case have the same
> > result for all command key pairs?
> 
> Oh, I see you tried changing the binding in comment #4, but does your test case
> do the right thing for another command key pair?

Yes, I mentioned this in comment #10... all other key combinations that I have tried seem to work fine. This doesn't necessarily mean that there are no other problems, but out of all the ones that I use on a regular basis, Command-D seems to be the only combination giving me problems.

Has anyone looked into my "wild hunch" that I mentioned in comment #12?
Comment 20 Missing name Mising name CLA 2010-12-21 22:39:23 EST
Is there any update on this?

This has made Eclipse on the Mac completely unusable for me for 4+ months now.
Comment 21 Scott Kovatch CLA 2010-12-22 02:01:08 EST
(In reply to comment #20)
> Is there any update on this?

No, because we haven't been able to reproduce it.

Let's see if we can get more information about what's going on with your machine. In your test case in comment #11, can you re-run it with a Thread.dumpStack() call just before the printf? Attach the stack trace.

Also, to help rule out some other preference or extension causing problems, please create a new user, log in as that user, and then try to reproduce the problem. Since Eclipse is more of a Cocoa app as opposed to an AWT application, there are other things that may be interfering.
Comment 22 burnabyjeff CLA 2011-03-02 19:38:20 EST
(In reply to comment #21)


This is a bug for me as well, just as alopecoid reported.

> Also, to help rule out some other preference or extension causing problems,
> please create a new user, log in as that user, and then try to reproduce the
> problem. Since Eclipse is more of a Cocoa app as opposed to an AWT application,
> there are other things that may be interfering.

I did as you suggested, I created a new user on my Mac Mini, and went directly to Safari and downloaded the same version of eclipse that is giving me the problem.  It DOES NOT HAPPEN with the new user, which is interesting.

I do have a workaround:  just change the 'delete line' binding to 'command-d command-d', so that when it interprets a single press as two presses, it executes the command just once.
Comment 23 Prakash Rangaraj CLA 2011-03-03 01:12:27 EST
*** Bug 338745 has been marked as a duplicate of this bug. ***
Comment 24 Lakshmi P Shanmugam CLA 2017-07-03 07:30:05 EDT
I'm unable to reproduce this and haven't seen any recent reports of this problem. Closing it, please reopen if you see this problem again.