I hope this is okay to ask on SO, I'm not sure. I apologize if it shouldn't be here.
I reinstalled Visual Studio Professional 2015 yesterday due to a few issues I was having. With the new installation, my line numbers have a very wide section where the mouse reverses direction and select the entire line if clicked. I don't recall this area being so wide on any of my previous installations of VS2015; I know it was there in the first place. Is there a way to disable this?
This is the area where this happens, boxed in green. It's much wider than the line numbers fill (only 147 lines in this file).
There are two "margins" available in Visual Studio 2015: Selection and Indicator available under Tools > Options > Text Editor > General > Display. Turning these off remove some, but not all of the "extra space" and the feature of highlighting an entire line is still there.
If you want to turn them off because the extra space is bothersome, keep in mind you will not be able to see breakpoints unless "highlight current line" is checked.
Related
The problem is displayed in this image.
Changing the item background color for Highlighted Reference helps a bit but they are still highlighted with boxes around them. In the old versions of Visual Studio it was caused by productivity power tools extension and there was an option to disable it. I do not have productivity power tools extension installed on Visual Studio 2022.
There seems to be options to disable this for languages like c#. Is there a way to completely remove this highlighting in editors for "All Languages"?
There doesn't seem to be a setting that turns it off for all languages, however if you change the RBG values to 30 for all three (if you are using the default dark theme in Visual Studio), you can essentially achieve this, since the highlighting will be the same exact color as the background, thus hiding it. To change these, click the "Custom..." button for both the items foreground and background and set the red, green, and blue values to 30. The rest of the values should automatically adjust.
The problem is, Highlighted Reference doesn't cover everything. You probably will also want to set the same RGB values for Highlighted Written Reference and Highlighted Definition, otherwise some things will still get highlighted.
Here is a .gif showing how this works will all three of these settings set to 30 in a C# code file:
You actually have one more Highlighted setting than my Visual Studio installation (perhaps I need an update) and that is the Highlighted Parameter one. Presumably, that controls the highlight of parameters to methods and such. I would assume you'd want that to also be set to 30 for the RBG values.
Also, you may notice that in the .gif it looks like there is a box around the item my cursor is under - that is because of the Highlight Current Line setting. You can also set that to 30 for the RBG values to achieve a 100% un-highlighted experience, but that might be going a bit extreme!
Is there a way, either built-in or by third-party extension, to disable triple-click from selecting the entire line while in a text editor? Either my mouse is too sensitive, or I'm inadvertently doing it, but more often than not, clicking a word, then copy / pasting it results in pasting of the entire line -- not my intention and very annoying. Ideally, it could be disabled (aka any click more than 1 just selects the word the cursor is over)
As already stated in the comments the problem is most likely that the word highlighting color is so similar to the color of selected text. So seems like we sometimes deselect a word instead of selecting it. And without a selection Ctrl-C copies the whole line. I had the same issue with JetBrains WebStorm. In Visual Studio for me it was ReSharper.
Changing the color helps. Tools -> Options -> Environment -> Fonts and Colors -> "ReSharper Usage of element under cursor". I made that darker such that selected text is clearly distinguishable.
Initial note: I'm not getting any responses over on superuser to my question, so please allow me to ask this here:
I inherited a VS solution with a bunch of unorthodox settings. I'm not at liberty to wipe out all those settings and start over. So there is 1 setting I want to change back to VS default but cannot find it.
In a normal/default VS c# environment, when you click the mouse on a line of code that hasn't been written yet (empty, no spaces, no code, no tabs), the cursor automatically positions to the beginning of where the line of code should begin. If it's just inside a foreach, if, or etc, it will indent a bit from the left edge according to tab rules, etc.
But in the weird VS settings I have, wherever I click, the cursor positions at that exact spot. So if I click on col 20 of the next line, the cursor remains at col 20 rather than auto-repositioning to col 5 or wherever it should be. This is SO annoying because I can't always eyeball where the cursor should be and I end up clicking at the end of the previous line, then hitting ENTER, at which time it goes to the next line and positions the cursor at the right place.
How can I fix this?
It is controlled by the Enable virtual space option. See Visual Studio options - Text Editor - C#. By default it is off/unchecked.
I resolved this issue by applying Sergey's suggested change (Visual Studio options -> Text Editor -> C# -> Enable Virtual Space [check]), but also enabled (Options -> Text Editor -> C# -> Tabs -> Smart).
I would like to show a vertical line, next to the linenumbers, in my visual studio 2010 between parentheses when my courser is between those 2 parantheses.
I alread had that option enabled, but somehow its gone.
edit: is nobody using that feature? one of the very nice things when you are debugging
Is no one using that feature??
Edit: so last push!! there must be a way to see where the space between parentheses starts and ends.
edit: here is an image
EDIT: I still haven't found what i'm looking for. VS is so powerful there must somewhere an option or a plugin. It is really useful when you can see where your { begins and ends }.
Anyone a clue?
I haven't seen the horizontal line feature since 2008. I hated it so I haven't been looking for it either.
You should however be able to see the braces being highlighted when your cursor is on them. If not, perhaps you've changed your theme or possibly some colors in your Options menu.
Here's what you should try:
Tools ->
Options(down at the bottom of the drop-down) ->
Environment ->
Fonts and Colors
Make sure the Show settings for: selector is showing Text Editor.
The one(s) you're looking for are Brace Matching (Highlight/Rectangle).
Attempt to change it to your choosing and see if the changes take place. If not, reset to the defaults and re-check it's enabled.
Also...
Another suggestion that can be handy to get a temporary look at the extents of the body you can hover your mouse just along the margin it will highlight the most nested body. You may have to do some tweaking of your colors to make it vibrant. I use a darker color and have my code block highlighting white. I know it's not what you're looking for but it might be somewhat of a band aid.
Situation
I have a plain text file where indentation is important.
line 1
line 1.1 (indented two spaces)
line 1.2 (indented two spaces)
line 1.2.3 (indented four spaces)
In Visual Studio 2008, when I pressed enter, the next line would also be indented four spaces.
However, in Visual Studio 2010, when I press enter, the next line is indented one tab.
Question
Does anybody know where, in the mountain of preferences under Tools > Options, I can return to the way that Visual Studio 2008 worked?
Under Options > Text Editor > Plain Text > Tabs, I see the following:
If I select "None", then I get no indentation when I move to the next line. If I select "Block", then I get TAB indentation (even though the previous line is spaces).
In Visual Studio 2008, my indentation is set to "Block", and I get spaces.
I have no idea what "Smart" indenting is, or why it is disabled.
"Smart" indenting is essentially asking the language service to do indentation, which covers cases like adding an extra indent level after an { in C# files. Since plain text files don't have a language service, it isn't available here. If it was, the behavior (matching indentation from the line above) would be whatever the language decides to do, though I'm pretty certain it respects the "Insert spaces"/"Keeps tabs" option.
"Block" indenting is asking the editor to take care of it, which it takes to mean "maintain the same indent level as the previous line". It appears that, in VS2008, it copied the indentation from the previous line, whereas VS2010 respects the "Insert spaces"/"Keep tabs" setting.
Can you file a bug on Connect about it? I'm not sure if it was changed on purpose or not, so it will help for this to go to our (the editor team's) triage people to make sure.