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: