Some times ago I was working with Visual Studio 2017 and if horizontal line of code bigger than VS window, VS was showing it in new line. Look to this picture
As you see in picture, horizontal lines of Assert takes more then VS window. And sometimes VS moved it in new line and showed green arrow icon under line. But now this formatting is disabled. Does anyone know how to enable this (I'm using c# 2005 keyboard )? I hope i could understand my problem.
You have to go to: Text Editor > All Languages > General (Or the language you want) then you tick the checkbox Word wrap(Also Show visual glyphs for word wrap if you want to see that arrow you mentioned.).
Related
In Visual Studio, I selected the lines and click "Comment out the selected lines" in the tool bar. The VS will put // in front of all selected lines. How do I change the style so that the VS put the selected lines in between /**/?
Currently, there is no such setting you want in C++ project. You can go to Developer Community to propose this new feature and post the link in comment. In addition, Visual Studio now supports Ctrl + Shift + / to comment and uncomment.
so I have been using VS Community for a while now to code in c++ and somehow must have activated reference hightlighting. Now every time my cursor is inside a word it highlights every occurence in the entire file. This gets very confusing especially inside nested loops:
I tried looking for reference highlighting but could only find it in the C# section in the options.
I also tried changing the background color of the highlight to the background color of the plain text but this still draws the rectangle highlight box around it.
Is there no way to disable this cursor highlighting for c++? Basicly I only want the highlight to show when I actually hightlight stuff.
If you want to disable all cursor highlighting, you could set True in Tools->Options->Text Editor->C/C++->Advanced->References->Disable Reference Highlighting.
If you want to customize the cursor highlighting, here is a solution for reference.
This tip was proposed by Sairama Jamalapuram. Syntax coloring for user-defined keywords is used for C++ files only.
Here are the steps you need to take to enable syntax coloring for user-defined keywords. The steps are taken from the online help.
In the same directory as msdev.exe (for Visual Studio .Net search
for ...\Microsoft Visual Studio.NET\Common7\IDE\devenv.exe), use the
Text editor or Windows Notepad to create a text-only file named
usertype.dat.
Add your keywords to usertype.dat, one keyword per line. Note: The
usertype.dat file is read during initialization. It cannot be
renamed, nor can it be reloaded during an editing session. The
syntax coloring mechanism checks the usertype.dat file last. Thus,
all previously defined color settings take precedence over the
user-defined keywords.
Save the file as a text-only file, exit, and then restart Visual
Studio.
From the Tools menu, choose Options.
Select the Format tab.
In the Colors box, select User Defined Keywords.
Set the font, font size, foreground color, and background color to
your preferences.
Click OK.
Restart DevStudio.
Since I started using Visual Studio with 2003, holding down control and clicking a piece of text would highlight that word allowing for easy copying and pasting. This was the case until I updated to 15.4. Now the same action turns the word into a hyperlink and takes me to its definition (the same way F12 would).
Does anyone know how to change this to behave the way it has for the last 14+ years?
Open Options -> Text Editor -> General
Uncheck Enable mouse click to perform Go to Definition
This definitely turns this behavior off, but I don't know how to go back to VS 2003 behavior, because I've been using Ctrl+Click to go to definition for a long time with extensions.
BTW, I use double click to select word and triple click to select line.
In Visual Studio 2015 Solution Explorer next to C++ files is a "++" icon, easy enough to understand, but I have one C++ file that has a red circle with a white minus sign in it over the "++" icon. I have tried making changes to this file and checking it into TFS, the icon does not change.
Short questions: What does a red circle with a white minus sign in it over the "++" icon mean??
Bonus question: I searched all over trying to get a list of the icons, without any success, does a list of these icons exist??
07.Nov.2016 Update: This question was asked and answered in 2012, but I feel this posting should remain, because both the question and answer include screen shots. A picture is worth a least a 1,000 words!
It means the file is excluded from the build. Right click on a file - Properties - Configuration Properties - General and see if the Excluded From Build is set to Yes. Setting it to No removes the icon.
Suppose I am writing an if statement in C++ with VS2008. I'm inside a function and therefore indented (a tab from the left margin, say). I type if{, hit enter and I'm now two tabs from the marging - I'm happy :-)
I move the cursor up a few lines to copy something and then back to just under the if{. Lo and behold, my cursor is now right against the left margin and I've lost my indentation. Grumpy! >:-(
I'm wasting my time retyping tabs and it's driving me bonkers. Please help me unlock the secret setting that allows me to get on with my work.
Edit: Incidentally, whilst developing in C# I experience the desired behaviour. It's just C++ that loses the auto-indentation.
To the best of my knowledge, there is no setting to get this to work in VS2008.
In VS2010, it does behave how you would expect.
If you can, I would recommend using VS2010. If you are doing c++-cli, you can set the project to use the .Net 3.5 framework, and then it compiles using VS2008. If you are doing vanilla c++, you can go into the project property pages, General and set the Platform Toolset to v90 to get it to compile using VS2008. Of course, you could just compile using VS2010 if that's an option for you.
If you view white space (Edit > Advanced > View White Space), you can see that when you press enter the tabs are not put into the file until some text is typed. When you click away, Visual Studio doesn't remember that you were indented.
A potential solution to you problem is in Tools > Options > Text Editor > C/C++ > General, you can check "Enable virtual space". This allows you to put the cursor anywhere and once you type a character it adds the tabs/spaces up to the cursor.
The option in C# that is missing from C++ is the check box "Indent block contents" in Tools > Options > Text Editor > C# > Formatting > Indentation.