Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's WebLog


My adventures embracing open source on CodePlex and at Microsoft

News

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: ,
Posted: Wednesday, September 19, 2007 3:00 AM by saraford

Comments

Matt Casto said:

I have a Microsoft Natural Ergonomic Keyboard 4000 which has a built in Back and Forward button.  These buttons automatically activate the Navigate Backward and Navigate Forward features in Visual Studio, which is really handy!  I'm not sure, because I don't have one of these atm, but I'd assume any mouse with a back/forward button might do the same.

Now, if I could just figure out a nice way to use the zoom slider in Visual Studio.

# September 19, 2007 10:14 AM

sean said:

Any idea if there's a way to drop these markers using the VS SDK?

# September 19, 2007 10:54 AM

Ben said:

Yay!!!  I wanted to navigate forward and backword for so long and didn't know how....

(Been using Visual studio for about year now.)

So here's big thank you from me!!

# September 19, 2007 12:09 PM

Rory Becker said:

This should also work on a 5-button mouse.

Left-side button = go back and Right-ride button = go forward... Just like in your browser.

More useful than the wheel on your wheel mouse.

Of course I have a 5 button wheel mouse so it's all good :)

# September 19, 2007 1:28 PM

Kim said:

Great blog!

I would like to see visual indications of the nav drops. ie. a small colored icon or graphic. CodeRush does that with markers.

# September 19, 2007 3:22 PM

droid said:

Did YOU know the Forward and Backward work in the Keyboard&Mouse Forward and Backward buttons... BUT only if you selected C# IDE settings. Atleast in Beta 2.

I filed a bug that I'd like it to work in C++/general settings too but it was closed. This is a problem because you cannot set them to work in mouse or keyboard through the shortcut settings in VS since they don't recognize the mouse or keyboard "extra" buttons. What mouse or keyboard these days doesn't have forward/backward button? None! So they should be recognized by VS.

# September 23, 2007 6:05 AM

Noticias externas said:

In a previous tip, we learned more than we ever wanted to know about go-back markers . Insertion points

# November 28, 2007 6:08 AM

Sara Ford's WebLog said:

After yesterday's tip on how Navigate Forward, Navigate Backward, and go-back markers work, did you know

# January 15, 2008 12:42 AM

Sara Ford's WebLog said:

In a previous tip, we learned more than we ever wanted to know about go-back markers . Insertion points

# January 15, 2008 1:05 AM

Visual Studio 2008 ワンポイント said:

昨日のワンポイント では [戻る] ボタンと [次に進む] ボタン、および移動マーカーについてご紹介しましたが、テキストを最後の移動マーカーまで選択する方法はご存知でしたか?これは Ctrl + 等号

# July 7, 2008 3:48 AM

Visual Studio 2008 ワンポイント said:

標準のツール バーには、[戻る] ボタンと [次に進む] ボタンがあります。 エディタでは、[戻る] は Ctrl + マイナス ( - ) キーに、[次に進む] は Ctrl + Shift + マイナス

# July 7, 2008 3:50 AM

Visual Studio 2008 ワンポイント said:

以前のワンポイントでは、 移動マーカー について、期待以上の内容を学べました。挿入ポイントは少しだけ違っています。これは移動マーカーと似ていますが、マウスをクリックしたりカーソルを移動したりした先の任意の位置を示します。移動マーカーの

# August 13, 2008 7:39 AM
New Comments to this post are disabled
Page view tracker