问题
A keyboard shortcut that I've used frequently going back several Visual Studio versions is Ctrl+Shift+8 to go back to where I was, after doing a F12 to Go To Definition.
In Visual Studio 2015, pressing Ctrl+Shift+8 doesn't seem to do anything.
Opening up Visual Studio 2013 and looking at the Tools | Customize | Keyboard dialog, Ctrl+Shift+8 is mapped to the command View.PopBrowseContext. In Visual Studio 2015, Ctrl+Shift+8 has that same command mapping, but the command doesn't seem to work.
Is there a way to get the View.PopBrowseContext command to navigate back after doing a Go To Definition (F12) in Visual Studio 2015?
回答1:
Visual Studio 2015 Connect -> View.PopBrowseContext command and others doesn't work (issue removed from Connect site by Microsoft)
Issue on GitHub -> Bring back Go to Definition Navigation Stack #14496
View.NavigateBackward (Ctrl+-) is not good replacement for View.PopBrowseContext (Ctrl+Shift+8). If you invoke Edit.GoToDefinition (F12) and then click a few times with the mouse moving the cursor around, all those moves are recorder in the navigation stack.
View.PopBrowseContext (Ctrl+Shift+8) redirects directly to the previous definition (the place that you invoked Edit.GoToDefinition (F12) last).
- View.PopBrowseContext
- Edit.GoToReference
- View.BrowseNext
- View.BrowsePrevious
- Edit.GoToDeclaration
- View.ForwardBrowseContext
Note: these commands were broken in Visual Studio 2015. Still do not work in Visual Studio 2017.
回答2:
A workaround in Visual Studio 2015 is to press CTRL+- instead (mapped to the View.NavigateBackward command) to go back after a F12 press, instead of trying to use View.PopBrowseContext / Ctrl+Shift+8. (Reference)
回答3:
When you first start Visual Studio, it offers you a choice of typical usage (not sure how it's called exactly): C++, C#, etc. I believe the initial keyboard binding depends on that choice.
I used FeinCtrl and noticed that View.PopBrowseContext
is mapped to Ctrl+Num *, and it works just fine. The Ctrl+Shift+8 is mapped to Edit.ViewWhiteSpace
for me...
Do you by chance have a conflict, when another command in a different scope is papped to the same shortcut keys?
来源:https://stackoverflow.com/questions/32097787/visual-studio-2015-ctrlshift8-view-popbrowsecontext-to-navigate-back-not-wo