Visual Studio IDE - return to previous

Visual Studio-2008Ide

Visual Studio-2008 Problem Overview


In VS2008, is there a way to return to the cursor’s previous position after pressing F12 to jump to a function definition? I know this is possible with some add-ons, but if there a way to get the core product to do this?

Visual Studio-2008 Solutions


Solution 1 - Visual Studio-2008

Ctrl+- should do the trick which is the standard keyboard shortcut for Navigate Backwards. Or using the navigation buttons in the standard toolbar.

This is explained on MSDN at https://blogs.msdn.microsoft.com/zainnab/2010/03/01/navigate-backward-and-navigate-forward/

On this MSDN page, you can see the following explanations

> 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).

Solution 2 - Visual Studio-2008

There was a command which did exactly you asking for: View.PopBrowseContext. It always returns you to the very place where you have pressed F12. It doesn't take in account any movements or edits you did after you have pressed F12.

By default in C# layout it is mapped to Ctrl+Chift+8, but you can assign it to any hotkey you want.

BTW, in VS2015 they decided to get rid of this command.

Update: The extension I've made to emulate this command is available on the marketplace now: PopContext.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPaul MichaelsView Question on Stackoverflow
Solution 1 - Visual Studio-2008PMNView Answer on Stackoverflow
Solution 2 - Visual Studio-2008SergeyTView Answer on Stackoverflow