Did you know... How to navigate forward and backwards in the editor all because of go back markers? - #041

In the standard toolbar, there’s the Navigate Backward and Navigate Forward buttons.

Navigate Forward and Navigate Backward standard toolbar buttons

In the editor, the Navigate Backward is bound to Ctrl+minus and Navigate Forward is bound to Ctrl+Shift+minus.   I find these commands most helpful when navigating amount multiple files or jumping around through callstacks.

That’s the basic editor navigation 101 course.  Now time for the advanced course.

You may have noticed that the Navigate Backward button additionally contains a drop down listbox.  This will show you all the places that have a “go-back marker.”  In other words, when you hit navigate backward, you are going to the most-recently visited go-back marker.

If we’ve done our jobs right, the go-back navigation should feel natural.  But if you are like me, you like to know the little ins-and-outs of how things work.

A go-back marker is dropped under the following conditions:

  • Incremental search (including reverse) leaves a go-back marker at beginning of search and another one at the end
  • A GoToLine or a Mouse-click that moves the cursor 10+ lines from current position (so 11 lines and more) drops a go-back marker at new location
  • A destructive action (after having moved the cursor to a new location) drops a go-back marker
  • Doing a Find (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

If you’ve found a condition where you’d like to see a go-back marker dropped, let me know.

Technorati tags: VS2005Tip, VS2008Tip