Why does the Visual Studio editor show dots in blank spaces? - visual-studio

I have a strange bug in the Visual Studio text editor.
All my blank spaces are replaced by a "."
public class Person
{
int age;
}
looks like this
public..class..Person..........................
{..................
..int age;...................
}.....................
I reset the settings to default. Didn't work.
I also re-installed VS2008. Still didn't work.
What's the error?

Visual Studio is configured to show whitespace.
Press Ctrl+R, Ctrl+W.
If you are using C# keyboard mappings: (thanks Simeon)
Press Ctrl+E, S.
If you want to use the menu: (thanks angularsen)
Edit > Advanced > View White Space

Looks like you have the view white space option enabled. Go to Edit -> Advanced -> and uncheck "View Whitespace"

In Visual Studio 2012
Go to
Edit -> Advanced -> View White Spaces
Or
Press Ctrl+R, Ctrl+W

~ FOR VISUAL STUDIO 6 ~
use: ctrl+shift+8
to toggle on/off.
(or manualy go to: Edit> Advance > "View Whitespaces")
goodluck!
Works also for Visual Studio 2008, when
Tools/Options/Environment/Keyboard/Mapping Scheme: Visual C++ 6
is selected.

Please press below buttons in combination of
Ctrl + R,W

I had the same problem and resolved by pressing Ctrl + R , Ctrl + W.

In Visual Studio vesrion 1.34.0 View -> Toggle Render Whitespace

Press ctrl + E followed by S key to remove the lines in Visual Studio 10

go to File -> Preferences -> Settings, this will open two panels side by side, the left one is default setting and the right one is user setting, you can add your setting on right panel, for this you can add "editor.renderWhitespace": "all".

In visual studio 2015, goto->view->formatting marks, unselect show

In Visual Studio 2019, this can also be configured in Tools -> Options -> General -> View whitespace

Related

CTRL+D doesn't work in Visual Studio 2022

CTRL+D (duplicates) It doesn't work in visual studio 2022 , How to change Ctrl+E,V To CTRL+D ?
I just had the same problem.
The issue for me was that Visual Studio 2022 had set the mapping scheme to Visual C# 2005 instead of (Default).
In the search bar at the top of Visual Studio 2022 (Ctrl+Q), search for key bindings, or go to Options->Environment->Keyboard.
Make sure the keyboard mapping scheme is (Default).
I hope it helps.
Duplicate line is implemented via Ctrl+E,V as explained here.
This operation does leave the clipboard untouched.
Command and respective keys are shown in the Edit Menu.
Go to TOOLS -> Options -> Environment -> Keyboard and then on 'Show commands containing:' search Edit.Duplicate and on 'Press shortcut keys:' press Ctrl+D and click on 'Assign' button.

How to collapse/expand only regions by keyboard shortcut in Visual Studio 2017?

I've found Quick Launch has CollapseRegions and ExpandRegions which functionality is actually what I need.
But I would like it to be toggled by key in like Ctrl+M,J instead of using Quick Launch like Ctrl+Q > CollapseRegions > Enter.
Is there any way to do that?
In Visual Studio 2017 :
Go to Options -> Text Editor -> C# -> Advance -> activate 'Collapse #regions when collapsing to definitions'
Explicitly to collapse all using Ctrl+M+O and for expand use Ctrl+M+X.

Duplicate line short cut does not work in VS 2013

I have Visual Studio 2013 and Resharper installed.
Until recently when I pressed Ctrl D, Ctrl D I was able to duplicate the line I was on.
Now it does not work.
How do I go about fixing this?
Go to Tools -> Options -> Keyboard. Then select command ReSharper.ReSharper_DuplicateText from list (autocomplete works).You may press Ctrl+D and assign it to selected command. It's possible to set scope (Global etc.). By default I have Text Editor and XAML scopes.

Visual Studio 2015: Disable Control+Click Navigation

After upgrading to Visual Studio 2015, holding control while clicking on a symbol navigates to that symbol definition. In prior versions, this would instead select the entire word.
How can I disable the navigation event when CTRL + Click(ing) a symbol, so that it highlights the word?
I do have Resharper (Ultimate 9.2) installed. The configuration option under Environment -> Search & Navigation -> Go to Declaration on Control + Click in the editor is not checked.
All the search engine results make mention of this being a feature of the Productivity Power Tools extensions in previous versions of Visual Studio. I do not have that extension installed.
I found my solution in the "Options - Text Editor - General" settings. This was on VS 2017 thou.
To disable navigation to symbol definitions in VS2015,
this one worked for me.
With Resharper Ultimate 2016.3.1, I could fix the issue by disabling "Rich mouse navigation in the editor". It can be found in Resharper Options window, under Environment > Search & Navigation.
Maybe updating Resharper could solve the issue.
Also, Productivity Power Tools is not installed on my machine.
In vs 2017 this setting is available in Tools -> Options -> Text Editor -> General -> Enable mouse click to perform Go to Definition.
You can uncheck it!
Go to ReSharper Options > Environment > Search & Navigation, then uncheck the following options:
Rich mouse navigation in the editor
Enable 'Smart go to declaration'
I finally solved it following the info I found on this page..
edit
Ensure you are using Visual Studio as your resharper keyboard scheme.
Environment -> Keyboard & Menus
Tools -> Options -> Environment -> Keyboard
To stop the go to declaration, select it and input a new key short cut for it. In this image I have demonstrated that I changed this short cut to ctr num 1 and could not change it to ctr num 3. On testing crt click does not no take me to the declaration.
Find the shortcut you want to remove, in this case Edit.NavigateTo and remove.
An update for Productivity Power Tools + VS2017. Instead of having settings for this feature, a separate plugin gets installed. So after installing PPTs, you'll have a new extension called Ctrl+Click Go To Definition. Not sure why we need that tool considering it's baked into VS, but...
Anyway, Disabling that extension (plus the other things mentioned in other comments for VS and Resharper) fixed my ctrl+click woes.
To switch to the Visual C# keyboard mapping scheme
On the Tools menu, click Options.
Expand Environment, and then click Keyboard.
Select Visual C# 2005 from the Apply the following application
keyboard mapping scheme drop-down list.
or you can do
Keyboard: CTRL + W
also plugin can be used
Keyboard Shortcut Exporter
you can import/export keymapping file

Show space, tab, CRLF characters in editor of Visual Studio

Where are the settings to show a space, tab, paragraph, CRLF, etc. (extended) characters?
Edit > Advanced > View White Space. The keyboard shortcut is CTRL+R, CTRL+W. The command is called Edit.ViewWhiteSpace.
It works in all Visual Studio versions at least since Visual Studio 2010, the current one being Visual Studio 2019 (at time of writing). In Visual Studio 2013, you can also use CTRL+E, S or CTRL+E, CTRL+S.
By default, end of line markers are not visualized. This functionality is provided by the End of the Line extension.
Edit -> Advanced -> View White Space or Ctrl+R,Ctrl+W for Visual Studio 2019
Display white space characters
Menu:
You can toggle the visibility of the white space characters from the menu:
Edit > Advanced > View White Space.
Button:
If you want to add the button to a toolbar, it is called Toggle Visual Space in the command category "Edit".
The actual command name is: Edit.ViewWhiteSpace.
Keyboard Shortcut:
In Visual Studio 2015, 2017 and 2019 the default keyboard shortcut still is CTRL+R, CTRL+W
Type one after the other.
All default shortcuts
End-of-line characters
Extension:
There is a minimal extension adding the displaying of end-of-line characters (LF and CR) to the visual white space mode, as you would expect. Additionally it supplies buttons and short-cuts to modify all line-endings in a document, or a selection.
VisualStudio gallery: End of the Line
Note: Since Visual Studio 2017 there is no option in the File-menu called Advanced Save Options. Changing the encoding and line-endings for a file can be done using Save File As ... and clicking the down-arrow on the right side of the save-button. This shows the option Save with Encoding. You'll be asked permission to overwrite the current file.
My problem was hitting CTRL+F and space
This marked all spaces brown. Spent 10 minutes to "turn it off" :P
The correct shortcut is CTRL-R-W like you don't have to release CTRL button while pressing W. This worked for me in VS 2015
For those who are looking for a button toggle:
The name of this command is View white space in GUI menu (Edit -> Advanced -> View white space).
The name of this command in the Add command popup is Toggle Visual Space.
If you use Visual Studio Code => View => Render Whitespace
That's it!
For me this setting was on, but didn't work. I had to turn it off and on again and than it worked! So this is a bug in Visual Studio Code!
If you use Visual Studio 2022 you can change the display options for whitespace etc. in Tools => Options => Text Editor => General and select "View whitespace"
The shortcut didn't work for me in Visual Studio 2015, also it was not in the edit menu.
Download and install the Productivity Power Tools for VS2015 and than you can find these options in the edit > advanced menu.
To see the CRLF you can try this extension: End of the Line
It works for VS2012+
For Visual Studio for mac, you can find it under Visual Studio -> Preferences -> Text Editor -> Markers and Rulers -> Show invisible characters
Please note you may need to restart Visual Studio for the changes to take effect
For completeness since I haven't seen it mentioned here, it is also in Options->Text Editor->General->View Whitespace.
In the actual version this Option ist under Editor: Render Whitespace

Resources