Community
Participate
Working Groups
Build Identifier: 20110319-2305 only after eclipse starts, that is first time after start, when trying Alt+left, it will go back in navigation history of the current file under editor even if it should go back to where it came from(ie. if just came from a different file via F3[aka open decl.], it will still go back in nav.history of the current file until no more nav.history for it(or at least 1 time) and THEN goes back to where it came from) ok I can't explain this well, sorry, just try reproducing it... Reproducible: Always Steps to Reproduce: to duplicate this: make a new java project, make two classes ============ package org.something; public class One { public static void main(String[] args) { Two.main(null); } } ======== package org.something; public class Two { public static void main(String[] args) { some(); } private static void some() { three(); } private static void three() { } } ============ 1. go on One.java and press F3 (aka Open Declaration) on main of Two.main(); line 2. while in Two.java press F3 on these calls, successively: some(); then on three(); 3. now click on One.java (don't press Alt+left yet, 4. quit eclipse 5. start eclipse, you should be in One.java 6. press F3 on main of Two.main(); call, then press Alt+left, this should get you back in One.java but instead it gets you back to declaration of three(); in the same Two.java file, which was the last place we were in Two.java before we quite eclipse 7. if you press Alt+left again it gets you back to One.java , so it took two Alt+left to get back; though I cannot reproduce it, it sometimes takes 5 or so alt+left to get back from such an F3 jump, while it should've been just one this only happens after you start eclipse (I think?! can't be too sure)
I need to say, when trying Alt+left on a real project, I noticed that when the aforementioned happens after going to a declaration (via F3) when actually getting back to the original file (where I pressed F3) [after like 3-4 of alt-left in the destination file) I am actually not getting back to the place where I pressed F3, instead I'm getting back further, as if I pressed alt-left 3-4 times in this file instead
The bug got introduced in 3.3 when we started to restore the editor selection. I assume that we first restore the selection for Two.java and then jump to the F3 location. Hence Alt+Left brings us back to where we restored the selection.
I want to add :) it seems that the files that had nav.history saved previously, whenever I reach them ie. via F3, and hit alt+left I go back in their own history first, and when that's depleted then I go back to my F3 location I tried this on at least 3 files, consecutively, although I did jump from the same file with F3... but this doesn't happen only at the start of eclipse, it happens also in the middle of working at any time, as long as the file I jumped to with F3 is "new" for this session (ie. I haven't jumped to it in this session and even if it wasn't open in editor in this session)
every time I F3 (open decl.) to a file and then I try to alt+left (nav. back) it will first deplete that file's nav. history (meaning it will go back in that file's history instead, until there's no more in that file) and then go back to my F3 location. Then if I F3 again in the same file, alt+left will get me back to the F3 location (since that file's history is already depleted) Eclipse SDK Version: 4.1.0 Build id: I20110518-2200
the F3 location being in a different file (obviously)
(In reply to comment #4) > every time I F3 (open decl.) to a file and then I try to alt+left (nav. back) > it will first deplete that file's nav. history (meaning it will go back in that > file's history instead, until there's no more in that file) and then go back to > my F3 location. Then if I F3 again in the same file, alt+left will get me back > to the F3 location (since that file's history is already depleted) > > Eclipse SDK > > Version: 4.1.0 > Build id: I20110518-2200 Can you please file a new bug with a concrete example? This one will treat the restore after Eclipse starts only.
ok I will but I believe they are one and same bug
it seems it only works when the files were left open in editor (ie. as opposed to close all, before exiting eclipse). I usually leave like 20 files open. Thus it seems to be the same bug? but it affects all files that were left open (though saved) when eclipse exited. If I Close All, then exit eclipse, then start eclipse, the alt+left has no issues coming back to the location where I pressed F3, in one step. If I leave files open (and I've previously navigated to them, ie. they do have nav. history) then when I reach them again via F3 they will first deplete their history when I do alt+left before I can return to the F3 location. tested on: Eclipse SDK Version: 4.1.0 Build id: I20110522-2200 Given that I can reach any of those opened files at any time during my development process, and they will act as described, do you think I should still report it as a different bug?
> Given that I can reach any of those opened files at any time during my > development process, and they will act as described, > do you think I should still report it as a different bug? No, if it's only for editors that are open during exit & restart then that's the same bug.
come to think of it, it appears that once the files are closed from editor view, their nav. history is entirely forgotten, yes? (at least in e4) so since they have no nav. history anymore, there is no possibility for this bug to manifest thus it must be that only if the files were left open their history will be remembered the next time eclipse starts, and thus only then the possibility for this bug exists. so I most likely had opened files which I reached lately in my development process which exhibited this bug, but it's still related to eclipse starting up with all the previously opened files, mostly likely as you said in Comment 2
Navigation history loosing One Last step when you restart eclipse.
(In reply to comment #11) > Navigation history loosing One Last step when you restart eclipse. I'm writing my own editor and calling: getSite().getPage().getNavigationHistory().markLocation(this); every time user navigate in it. Everything works fine, and all steps recorded correctly, and could be navigated using Back/Forward buttons. But once I restart the Eclipse, it always loose one last step in the Navigation history. To avoid it I have to add additional call to the getSite().getPage().getNavigationHistory().markLocation(this); with a dummy state of the Editor, every time I save the state of the Editor in saveState(IMemento memento). It doesn't looks good in the code, and better to be fixed by the navigation framework. I also noticed that the same problem exist with other editors in the Eclipse. If the problem expressed by me is not related to the current defect, I will gladly file a new defect.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.