Prevent Visual Studio to scroll to the end of file when pressing Ctrl A (select all) - visual-studio

It's basically in the title.
Whenever you "select all" in the Visual Studio code editor, the editor will scroll down to the bottom of the file. Is there a way to prevent this?
I'm using Visual Studio 2008 at the moment, but this applies to all versions.

No, you cannot change this behavior.
Microsoft has been aware of this since at least VS 2010, but either doesn't think it's a bug or doesn't think it's important enough to fix.
From their response to a 2010 bug report filed on the issue:
We unfortunately do not plan to change Ctrl+A's scrolling at this
time, so we're unfortunately resolving this issue as Won't Fix for VS
2010. However, it will remain in our database to be revisited for a future release of Visual Studio.
Source: Microsoft Connect

A quick Ctrl-Z-Ctrl-Y will get you back to where you were. If you tend to do a Ctrl-S Ctrl-A Ctrl-C a lot then just get used to this whole chain instead: Ctrl-SACZY. Or, create a macro: https://msdn.microsoft.com/en-us/library/a0003t62%28v=vs.90%29.aspx

I was struggling with this myself, but the "undo" suggestion gave me an idea and I feel kinda dumb for not thinking of it earlier. Visual Studio includes "Navigate Backwards" and "Navigate Forwards" buttons (CTRL-, and CTRL+, respectively). So after you finish selecting and copying, simple click the navigate backwards button or type CTRL- and voilà! you're back where you were.
I know it doesn't stop the scroll to begin with, but at least it puts your cursor back exactly where you left it!

Related

Visual Studio 2012 Keyboard Freezing

I am having an issue within the razor view in Visual Studio 2012. For some reason, most of the time when I am trying to edit a style property, my keyboard freezes and doesn't allow me to type anything.
<section style="height: 15[Try to edit here]">
For instance, trying to add in a zero or 'px' where the "Try to edit here" has been placed above is impossible as the keyboard freezes.
I have ReSharper 7.1 installed, I'm not sure if that is the culprit?
Closing the tab and re-opening it fixes the issue, but it then re-occurs later on (not sure if there is a pattern as to when it re-occurs)
This happens to me often. I just switch tabs and come back and it doesn't happen(for sometime of course :-)). It could be some kind of unresolvable bug although i would suggest that you uninstall ReSharper and try again to see if it gets fixed.
It happens to me and my other colleagues as well.
I have found it to be linked to having a floating code window(s). Unlike the floating window for something like Find Results (without a title bar), these appear almost like another instance of Visual Studio. These do not come to the front when the main Visual Studio Window is selected. I have found the keyboard stops responding only on these windows if there is a Find Results kind of floating window open. When the problem occurs, clicking on another VS window and come back sorts it.
In earlier versions of VS, any pulled code windows appeared without a thick title bar and window controls box.
I tried posting images of the two kinds of floating windows but don't have enough reputation to do so! Let me know if it is confusing and I'll try to clarify.
This may not be the only way for this problem to occur but this is what I've observed consistently in the last few weeks of using Visual Studio 2012. I have C# environment settings with Resharper 7 and Reflector installed.

"Cannot navigate to definition" annoyance in Visual Studio 2010

I just switched to Visual Studio 2010, and now whenever I select something, Ctrl+C to copy, click somewhere else, and Ctrl+V to paste, I get an error message "Cannot navigate to definition." After that, it I try it again, it works. What fantastic new 'feature' should I be turning off to stop this?
Bah, it's a bug in Microsoft Productivity Power Tools for Visual Studio 2010. the "Ctrl+Click Go To Definition" feature. Apparently, when I click a new location and then press "Ctrl+V" - if I do it quickly enough, it interprets it as a Ctrl+Click and immediately tries to trigger a navigation, even if I clicked on an empty space. The error comes because it doesn't know what I'm trying to navigate to (answer: I'm not).
I have/had similar issues in VS 2012 (Premium).
I've tried the following:
removed all bin and obj folders from project's folder: works most of
the time.
repaired VS 2012 (add/remove bugrams (programs) > repair). Didn't
help much.
Close and opened VS 2012: didn’t help much either.
I've noticed than I couldn't open only files that weren't check-in in
TFS. I check-in them and then VS started working normally.
Dunno if this issue will appear again tough.
Hopefully this would help someone.
BR
you can remove the GoToDefProPack.dll file from the following location:
C:\Users(myUserName)\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\Productivity Power Tools\10.0.20318.14
to disable this feature completely.

Visual Studio 2010's Solution Explorer is too sensitive

If I click on something (that is click and let go) in the solution explorer and move the mouse too quickly on two quickly or click on something else too soon, Visual Studio interpretes that as a move. I'm hooked up to Visual Source Safe, so most of the time it asks me if I'm sure. But every once in a while it doesn't, and I have no idea the file has been moved/copied. As a result I get compiler errors (or worse runtime issues) that are nearly impossible to track down. Is there a fix to this? Any suggestions? It is very annoying.
Try the VSCommands extension
They have a "Prevent accidental Drag & Drop in Solution Explorer" feature

Visual Studio 2010 doubleclick behind #region to open it?

in Visual Studio 2008 it was possible to open a collapsed #region by simply double clicking somewhere behind (to the right) of the #region.
Now in VS 2010 you have to double click exactly the #region, double clicking behind it just selects the #region.
I've browsed the options but didn't find anything helpful and neither did google help.
Does anyone know of a way to switch back to the old behavior?
Thanks,
Florian
In Visual Studio 2010 the editor has been rewritten from scratch. It is quite likely that they just "forgot" to re-implement this functionality, thus causing a regression. If you feel strongly about bringing it back, I'd open a new bug at https://connect.microsoft.com/visualstudio/feedback
I don't think you can do it with the mouse anymore. Your best alternative is Ctrl+M, M (that toggles the current outline section).

How do I make the Enter key on intellisense when typeing in VB react the same way as in C# in Visual Studio?

I'm using Visual Studio 2008 and I'm used to C# where when Intellisense pops up, I select what I want by hitting enter and it doesn't skip down to the next line. In VB when I hit the enter on intellisense, I jump to the next line. Does anyone know where the setting for this intellisense option might be?
Hitting the SPACEBAR or TAB key in VB does the same thing that ENTER does in C#.
I know that this doesn't really answer your question, but intellisense is designed to work so that you just push the "next" character to choose the highlighted item (such as open parenthesis, period, semi-colon, etc).
I was bothered by this behavior in VB as well. This will be fixed in the next version of Visual Studio with a new setting for enter-key behavior.
https://github.com/dotnet/roslyn/pull/11873
Corrected link: https://github.com/dotnet/roslyn/pull/11769

Resources