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

Bug 187372

Summary: Inlined rename refactoring should use HOME/END keys better
Product: [Eclipse Project] JDT Reporter: Robert Konigsberg <konigsberg>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 3.3   
Target Milestone: 3.3 M7   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Robert Konigsberg CLA 2007-05-16 15:57:17 EDT
When using the new-fangled in-editor Rename refactoring, the Home/End keys should have a special function.

In the example below, [ and ] represent the bounding of the rename refactoring, and | represents the cursor.

public void [myMe|thod]() {

Right now, pressing HOME will move the cursor before the 'p' in public. Similarly, pressing END will move the cursor after the '{'. I'd like to see the following behavior:

Pressing HOME will move the cursor before the 'm' in myMethod and pressing END will move the cursor after the 'd' in myMethod. (this should hold true if the cursor is already before the 'm' or after the 'd'.

Pressing HOME+HOME or END+END should break this special use of HOME and END. Pressing HOME+END or END+HOME, however, should navigate between both ends of the bounded area.
Comment 1 Dani Megert CLA 2007-05-17 02:13:32 EDT
This has been fixed a while ago.
Comment 2 Robert Konigsberg CLA 2007-05-17 03:10:01 EDT
Hey, look at that! It's in 3.3M7! Neat!

A small note about what I see in 3.3M7, Daniel.

Using the example
void [fo|o](int x) {

1. I see that CTRL-Shift-R+Home+Home navigates to [|foo and then |void.
2. I see that CTRL-Shift-R+End+End navigates to foo|] and then {|
3. I see that CTRL-Shift-R+End+End+Home navigates (finally) to [|foo (That's great!)
4. However,  CTRL-Shift-R+Home+Home+End navigates to {|.

In other words, existing feature is not necessarily symmetric. Shall I open a new bug?
Comment 3 Martin Aeschlimann CLA 2007-05-18 04:46:47 EDT
Markus, can you comment on comment 2?
Comment 4 Dani Megert CLA 2007-05-18 11:19:22 EDT
>3. I see that CTRL-Shift-R+End+End+Home navigates (finally) to [|foo (That's
>great!)
That's not what I see when using I20070517-1700. It goes to beginning of void and hence the feature is symmetric.
Comment 5 Robert Konigsberg CLA 2007-05-18 17:00:01 EDT
I downloaded 3.3M7 on my linux workstation and found even different behavior. That is, Home+Home+End navigates to the end of the line and End+End+Home navigates to the start of the line. That's consistent, but not the same as the behavior I saw on my win32 wkstn at home.
Comment 6 Robert Konigsberg CLA 2007-05-18 17:00:46 EDT
Sorry I accidentally closed the bug.
Comment 7 Dani Megert CLA 2007-05-19 02:50:18 EDT
That's intended.
Comment 8 Dani Megert CLA 2007-05-19 02:55:16 EDT
>Home+Home+End navigates to the end of the line and End+End+Home
>navigates to the start of the line.
Maybe you have smart navigation off. If so, Home goes to the beginning and End to the end of a line.

Also note, that the linked mode start/end positions will only be hit if the caret is inside the linked mode.

I just verified that this works as described in 3.3 M7 and 3.3 RC1.
Comment 9 Robert Konigsberg CLA 2007-05-21 00:28:30 EDT
Yeah. OK, thanks for taking the time to review this issue with me. I'm very excited about 3.3.

I'll let someone else close it this time. :)
Comment 10 Dani Megert CLA 2007-05-21 03:35:44 EDT
.