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

Bug 89265

Summary: "Rename in File" moves cursor position
Product: [Eclipse Project] Platform Reporter: Jared Burns <jared_burns>
Component: AntAssignee: Jared Burns <jared_burns>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Darin_Swanson, eclipse
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jared Burns CLA 2005-03-28 14:39:43 EST
1. Place the cursor inside the word "default" in the target node.
2. Press shift+alt+r to Rename in File.
3. The cursor is moved from the target node to the project node.

The cursor shouldn't be moved.

<project name="project" default="default">
    <target name="default" description="--> description">
        <sleep seconds="2"/>
    	<echo>Hello, world!</echo>
    </target>
</project>
Comment 1 Darin Swanson CLA 2005-04-06 00:33:05 EDT
I am not sure that there is much I can do here. 

The LinkedModeUI on enter goes to the first UI position.

It would appear to me that setExitPosition should be resetting the cursor to 
the correct location...Dani can you comment or ask someome to comment who is 
familiar?
Comment 2 Darin Swanson CLA 2005-04-06 00:36:43 EDT
Ahhh..I could try being smarter about the order of the positions as I add them 
to the group...but I am still interested in the exitPosition question :-)
Comment 3 Dani Megert CLA 2005-04-06 05:02:36 EDT
Tom, please answer.
Comment 4 Tom Hofmann CLA 2005-04-06 06:37:59 EDT
LinkedMode stays where it is upon exiting unless you have defined an exit
position (setExitPosition). 

If you *have* defined an exit position, the linked mode jumps there *only* if
the mode is terminated regularly (usually by pressing <return>), but not if you
cancel the linked mode (usually by pressing <Esc>), in which case the caret is
never moved.

Note that you can modify the exit behavior a little by setting a custom exit
policy - however you can not veto above behavior, you can only add additional
cases where the linked mode is left.

(In reply to comment #2)
> Ahhh..I could try being smarter about the order of the positions as I add them 
> to the group...

The (tab stop) order of the positions defines which position is jumped to first.
Local rename in the Java editor orders the position from the location where it
is invoked onward, wrapping around at the end of the document.

Comment 5 Darin Swanson CLA 2005-04-29 18:06:19 EDT
Fixed in the RenameInFileAction

note bug 93267
Comment 6 Darin Swanson CLA 2005-04-29 18:06:33 EDT
Please verify Jared.
Comment 7 Jared Burns CLA 2005-05-02 19:21:01 EDT
Verified.