Bug 567321

Summary: "Go to last edit location" doesn't work after closing editors
Product: [Eclipse Project] Platform Reporter: Marvin Fröhlich <eclipse>
Component: UIAssignee: Andrey Loskutov <loskutov>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: arikast, digga1404, dzym, jonah, Lars.Vogel, loskutov, ma.becker, malaperle, mistria, yw64
Version: 4.17Keywords: regression
Target Milestone: 4.21 M2   
Hardware: PC   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=72773
https://bugs.eclipse.org/bugs/show_bug.cgi?id=574800
https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/183341
https://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=cc5a9e8582f2b91e676711c33b94f440390e4149
Whiteboard:

Description Marvin Fröhlich CLA 2020-09-24 07:50:40 EDT
I believe 4.17 introduced a forward button for "last edit location". Fine. And there is a history longer than 1. Also very cool.

Unfortunately the function doesn't jump to the last edit location anymore, but to one farther away in the history.
Comment 1 Andrey Loskutov CLA 2020-09-24 08:03:32 EDT
Please provide exact steps to reproduce. The "last edit" jumps to last edit for me.
Comment 2 Marvin Fröhlich CLA 2020-09-24 09:40:09 EDT
Sorry, I thought, it wasn't working all the time. Because every time I used it by accident, it failed.

Now I can't reproduce it intentionally. I will report back when I have a parcours.
Comment 3 Marvin Fröhlich CLA 2020-09-24 10:54:42 EDT
Ok, now I have some steps for you.

1. Open two classes.
2. Edit someting in class 1.
3. Edit someting in class 2.
4. Close class editor of class 2.
5. Navigate to somewhere else.
6. Hit "go to last edit location".

You will end up at the last edit location on class 1, skipping that of the closed class 2.

Maybe this is intentional. But it's not, what I need. And this has changed.
Comment 4 Andrey Loskutov CLA 2020-12-01 11:18:40 EST
I see it sporadically, I must confess that with the two buttons logic it is hard to understand where I'm supposed to land after using forwards / backwards.
Comment 5 Jonah Graham CLA 2020-12-01 12:00:04 EST
(Bug 72773 fix is very cool - not fully used to it yet)

I can reproduce Comment 3. It seems that closing the editor seems to reset the location in the history to the oldest item. If I do "Next Edit Location" repeatedly after step 6 I get back to the location I expect.
Comment 6 Andrey Loskutov CLA 2021-07-24 12:43:40 EDT
*** Bug 574800 has been marked as a duplicate of this bug. ***
Comment 7 Eclipse Genie CLA 2021-07-24 12:50:15 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/183341
Comment 8 Andrey Loskutov CLA 2021-07-24 17:41:57 EDT
The original code navigated through the history backwards trying to cleanup positions on old editor document, trying to mimic old behavior. This unexpected history navigation happened also in case of multiple editors opened from the text Search, if the "reuse editors" was enabled (that is default).

(In reply to Eclipse Genie from comment #7)
> New Gerrit change created:
> https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/183341

That should not do anything on opening/closing editors and should not go backwards on re-using editors.
Comment 10 Andrey Loskutov CLA 2021-07-26 05:44:34 EDT
I think the patch should fix the problem now, but would be great if someone (ideally Ari / Lars) could verify if that edit navigation still works as designed.

The fix is in latest SDK nightly, see https://download.eclipse.org/eclipse/downloads/drops4/I20210725-1800

Feel free to reopen if the problem isn't fixed properly.
Comment 11 Lars Vogel CLA 2021-07-26 06:53:04 EDT
Tested with Eclipse SDK

Version: 2021-09 (4.21)
Build id: I20210725-1800
OS: Linux, v.5.4.0-80-generic, x86_64 / gtk 3.24.20, WebKit 2.32.0
Java vendor: AdoptOpenJDK
Java runtime version: 16.0.1+9
Java version: 16.0.1

and a bunch of Asciidoc file reference for this back / forward never worked reliable and AFAICS this works fine. Also works fine for me with Java files.

Thanks, Andrey.