Navigate Backward and Navigate Forward
Keyboard: CTRL + -; CTRL + SHIFT + -
Menu: View -> Navigate Backward; View -> Navigate Forward
Command: View.NavigateBackward; View.NavigateForward
Versions: 2008,2010
Published: 3/1/2010
Code: vstipEdit0024
The editor remembers locations when you move in a single command more than several lines away from where you are currently working, or if you edit in a particular location that is not adjacent to the last place you edited.
The goal is to remember interesting locations so that you can recall where you have been working without remembering so many locations the feature is not useful (such as every character typed, or every line entering several new lines of code one right after the other).
A go-back marker is dropped under the following conditions:
An incremental search (including reverse) leaves a go-back marker at the beginning of the search and another one at the end.
A Go To Line action, like CTRL + G, or a mouse-click that moves the cursor 11 lines or more from the current position drops a go-back marker at the new location.
A destructive action (like hitting Backspace) after having moved the cursor to a new location drops a go-back marker.
Doing a search, like Ctrl+F, drops a go-back marker at the found location.
Opening a file drops a go-back marker wherever the cursor was on the old file and drops another on the opened file.
So with all that, welcome back to the wonderful world of the Navigate buttons (and keyboard shortcuts, too)! These gems make travelling around your code much, much easier:
Comments
Anonymous
April 09, 2010
Thank you, now I understand the logic behind the navigate Forward/backward better.Anonymous
November 28, 2011
Why don't you leave a go-back marker when a file is closed also? the same way you do when you open a file (Opening a file drops a go-back marker wherever the cursor was on the old file and drops another on the opened file.) That way someone could hit CTRL + (-) and open the file in the exact position he was when he closed it. Is there a way to do this manually.Anonymous
November 28, 2011
Andreas, Sadly all the go back markers in a file are removed when the file is closed so this isn't possible by any means I know of. ZAnonymous
August 12, 2012
Why not use the more standard ctrl-left/right?Anonymous
December 13, 2012
The incremental search appears to pollute the navigation history with the intermediate and irrelevant partial matches too. When I jump from one part of the code to another by search term, then try to return to my original code location, it steps back through all the partials. The blog entry suggests that it works how I'd expect it to work (just leaving one at the very start and the very end of the search), but it doesn't seem to. As a work-around, setting temporary bookmarks almost works faster to return to the previous location.Anonymous
December 13, 2012
Dwayne, Remember the rules for go back markers are additive so if ANY of the rules are met it will drop a marker. That could be what is happening in your case. Z