I use a wide screen and like to code in 16:9. So sometimes there is a string.Format... or whatever the is larger than the old 4:3 screen format. But VS does not want to use the avaiable space and just always makes a line break at about 50% of the visible line.
Where can I adjust the automatic line break to the wider screen?
btw I am using ReSharper (5.1).
example:
I think this is ReSharper's doing. In ReSharper | Options | Languages | C# | Formatting style | Line Breaks and Wrapping, under Line wrapping there is an entry Right margin (columns) - adjust this upwards to match the width you want ReSharper to wrap to.
I don't believe VS on its own will reflow text.
Note that there is a VS option to display wrapped text (Edit | Advanced | Word Wrap), but as can be seen from the line numbers when this is turned on, that doesn't actually change the text.
Related
I'm having a problem where I press enter at the end of the line and the cursor appears on the next line. When you type your first character the editor should be inserting spaces for the indent but it is inserting tabs.
Under 'Options | Text Editor | All Languages | Tabs' I have 'Insert spaces' and Tab size and Indent size are 2.
Under 'Options | Text Editor | C/C++ | Tabs' I have Smart Indenting and 'Insert spaces' with Tab size and Indent size are 2.
Am I missing another option?
So what I discovered is kind of embarrassing. Someone in our group decided to play a joke and created a .editconfig file. I didn't realize this and wasn't even looking for it.
So maybe look to see if that might be it.
But the link 'doug' provided is also very important. That one caught me another time.
Thanks everyone.
My problem is twofold. I'm using Beyond Compare integrated with Visual Studio 2015 as my Compare/Merge tool. While looking at my list of 'Pending Changes', I see a file which if I 'Right Click -> Source Control -> Compare with Latest Version', I can see no differences in the text compare as you can see below:
However, if I do a hex compare of the same, I get the following result:
I can see it's somehow gotten the EF BB BF at the starting and the Beyond Compare notes this difference with a red bar in the left side window.
On other occasions, I've seen files in 'Pending Changes' with 0d0a at the end which is apparently for a newline character but again Beyond Compare doesn't show this as a difference in Text Compare (I've seen Git GUi show it as a difference in the past).
How can I get Beyond Compare to ignore changes like these that don't show up in the Text Compare when it considers a particular file as a 'pending change' so I don't see it in the 'Pending Changes' window in the first place?
OR, if that's not at all possible,
How can I get Beyond Compare to show these changes in the default text compare so I can undo them easily?
To make the extra newline character show as a difference in the Text Compare:
Click the Rules toolbar button (referee icon).
In the Importance tab, check Compare line endings (PC/Mac/Unix).
To make it the default for new Text Compare sessions, change the dropdown from Use for this view only to Also update session defaults before you click OK.
If you turn on View > Visible Whitespace, the extra newline character will show as a red difference. When this setting is on, it will also show Windows style newline on one side and Unix style newline on the other side as a difference.
As AdrianHHH said, the EF BB BF is a UTF-8 byte order mark. It isn't possible to add or remove a BOM in the Text Compare. In the Hex Compare, it is possible to delete the BOM from a file.
How to do same behaving in Sublime Text as in Visual Studio, when using column selection
for example if there is a line break in a text, the cursor in Sublime go to beginning of a line
And this is behavior in Visual Studio desired behavior
Thanks
While you may want this functionality for other reasons, it seems like you are using it to adjust the indentation of code blocks. Fortunately, there is a much easier way of doing this. Select the text for which you want to change the indentation, then press Ctrl] to increase the indentation (move block right), or Ctrl[ to decrease indentation (move block left). You can also increase indentation by selecting the desired lines and hitting Tab, and using ShiftTab to decrease it. The one place I can think of where multiple selections would come in handy is if, for some reason, you need to indent/dedent by fewer spaces than are in your tab stop. For example, if I have some code that's indented 3 spaces, and I want to change it to 4 (using the Indent Using Spaces setting in the View -> Indentation menu), I would use a multiple selection to put a cursor on each line, then use Space or Backspace to adjust spacing appropriately.
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.
Resharper's code formatting is generally fine, but it seems completely broken when dealing with very long lines. For example look at this piece of code:
I do want some kind of line wrapping, but it should look ahead and indent less if necessary to avoid ridiculous amounts of line breaks. Something like this would be great:
Is there any way to make Resharper do this?
Alex Berezoutsky of Jetbrains has suggested to turn off "Indent array, object and collection initializer" checkbox in the "ReSharper | Options | Languages | C# | Formatting Style | Other" dialog. It's not ideal IMO for shorter lines, but it does look much better on very long code lines.
I guess it's the best workaround for this problem at the current time.
I admittedly haven't plugged your code into my IDE to try it so I don't have exact setting values for you, but have a go at tweaking the line wrapping options in R# options.
Go to Resharper | Options
Under Languages expande C# and then Formatting Style, click on Line Breaks and Wrapping
Review the settings in that category