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

Bug 65955

Summary: [key binding] Ctrl+Insert/Shift+Insert and ^C/^V on Windows NT do different things
Product: [Eclipse Project] JDT Reporter: Anton Tagunov <atagunov>
Component: TextAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P2 CC: dirk_baeumer, jverhaeg, mveurman
Version: 3.0   
Target Milestone: 3.0 RC3   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description Anton Tagunov CLA 2004-06-07 08:33:29 EDT
Section A)

Steps:

0) Make sure you're on Windows NT

1) Create the following interface

public interface A
{
	void a( B b );
	
	interface B
	{
		void b();
	}
}


2) Fold interface A.B

3) ^A

4) Ctrl+Insert

5) run notepad

6) paste clipboard back to notepad

Observed:

public interface A
{
	void a( B b );
	
	interface B
}

Expected:

public interface A
{
	void a( B b );
	
	interface B
	{
		void b();
	}
}

Build: 200405280010

Notice, that ^C and mouse menu action Edit/Copy DO copy contents of folded 
section, but Ctrl+Insert does not

Section B)

Steps

1. create class B in file B.java

import java.util.HashMap;
import java.util.Map;

public class B
{
	public static void main( final String args )
	{
		Map map = new HashMap();
	}
}

2. Create class C in C.java

public class C
{
	public static void main( final String args )
	{
	}
}

3. Select body of main in B.java (that is select the line Map map = new 
HashMap();)

4. Do Ctrl+Insert in B.java

5. Do Shift+Insert in C.java

Observed:

import java.util.HashMap;
import java.util.Map;

have not appeared in C.java

Expected:

if in steps 4 and 5 we used ^C / ^V then the imports would have gotten copied
to C.java. I expect exactly the same to happen regardless of wether I press ^C 
or ^Ins, ^V, or Shift+Ins.

Notice:

in the last example all of the following combinations fail to transfer imports:

Ctrl+Ins/Shift+Ins
^C/Shift+Ins
Ctrl+Ins/^V

and on the following one does work

^C/^V
Comment 1 Dani Megert CLA 2004-06-15 12:11:49 EDT
Ctrl+Insert, Shift+Insert, Shift+Delete are not bound to their corresponding
commands.
Comment 2 Dani Megert CLA 2004-06-15 12:13:08 EDT
I am increasing this since many people using Windows use Insert and Delete keys.
If we don't bind them we have problems with
- folding
- smart copy/paste (imports)
...
Comment 3 Dani Megert CLA 2004-06-15 12:13:24 EDT
*** Bug 65791 has been marked as a duplicate of this bug. ***
Comment 4 Dani Megert CLA 2004-06-15 12:27:21 EDT
*** Bug 65325 has been marked as a duplicate of this bug. ***
Comment 5 Kai-Uwe Maetzel CLA 2004-06-16 08:57:54 EDT
Fix: Introduce keybindings. Adding Dirk for second vote.
Comment 6 Kai-Uwe Maetzel CLA 2004-06-16 13:58:10 EDT
Approved by Dirk & Kai.
Comment 7 Dani Megert CLA 2004-06-17 06:50:57 EDT
Needs to be discussed with Platform UI: they already register those key bindings
for "gtk" and "motif" - why not for win32?
Comment 8 Dani Megert CLA 2004-06-17 11:23:02 EDT
Discussed with Platform UI. We do not want to take the risk to change the key
binding for all of those retargeting cut/copy/paste. For now we will add the key
binding definitions to the text editing context and discuss after 3.0 whether
this should be in the general context (see bug 67651).

There was one minor problem with adding those key bindings: the UI showed those
new key sequences in the context menus instead of Ctrl+X/C/V. This is fixed by
also defining the original key bindings for cut/copy/paste again.
Comment 9 Dani Megert CLA 2004-06-17 11:24:14 EDT
Reviewed by Kai
Comment 10 Dani Megert CLA 2004-06-17 11:25:21 EDT
Fixed in HEAD.
Will be released into I200406171600
Comment 11 Markus Keller CLA 2004-06-18 09:12:23 EDT
Verified in 200406180010.