Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346669 - [navigation] Navigation History doesn't remember prev. pos after Quick Fix (change type of field)
Summary: [navigation] Navigation History doesn't remember prev. pos after Quick Fix (c...
Status: CLOSED DUPLICATE of bug 73224
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 08:56 EDT by John CLA
Modified: 2011-06-06 09:37 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John CLA 2011-05-20 08:56:23 EDT
Build Identifier: I20110518-2200

after doing a the Quick fix of: Change type of `fieldX` to `type` 
and pressing Esc (instead of Enter) then Alt+left (Navigate->Back) doesn't go back to where the quick fix was issued, instead skips that backstep.

Pressing Enter (instead of Esc, above) does automatically return cursor position to where the quickfix was issued.

I've been hitting this too many times to not report it as it seems to take quite some time to navigate back to where I was and also adds some frustration

Reproducible: Always

Steps to Reproduce:
do this code:
package org.some;


public class X
{
	public int field;
	
	public boolean stuff() {
		return field;
	}
}


=====
2. position yourself on the "field" in "return field;" line
3. press Ctrl+1 to bring up Quick fix and choose `Change type of field to boolean`
4. press Esc
5. press Alt+left or choose Nagivate->back

at this point either nothing happens or you're not going back to the "field" on the "return field;" line as I would expect.

Note that if you change step 4 to "press Enter" then you automatically are returned to the "field" in the "return field;" line, so no need to press Alt+left to get back. So yeah it's probably the right(and only) way to go back but I always press Esc mostly because I find other variables(fields) nearby that I want to change or add some comments about (while I'm still in that area of fields) and then I want to Alt+left to go back to where I was when I applied the quick fix, but no luck. I think the history point for that is never saved, I mean, right before the quickfix is executed.
Comment 1 John CLA 2011-05-20 09:09:19 EDT
you can also try without any step 4.
Comment 2 John CLA 2011-05-21 05:15:48 EDT
perhaps a more fitting example would be:
package org.some;


public class Y
{
	public final int field=0;
	
	public void stuff() {
		field=1;
	}
}


then go to field=1; line and Ctrl+1 and apply the quick fix for `Remove 'final' modifier for 'field'`, then try Alt+left to go back to the field=1; line which will not do so. Neither will Ctrl+Q aka Last Edit Location (but that's understandable for Ctrl+Q)

thanks in advance :)
Comment 3 Remy Suen CLA 2011-05-25 10:35:42 EDT
I guess this is a question of how fine-grained you want the history to be. I believe the text editors are interacting with the navigation history as expected though.
Comment 4 Dani Megert CLA 2011-06-06 09:37:42 EDT

*** This bug has been marked as a duplicate of bug 73224 ***