Line length

Hi,

I can't find the option to set the maximum line length and display the print margin. I would also like to know if the auto-formatter automatically reorganizes the code so it doesn't exceed the line length?

Can someone help?

[234 byte] By [knallbunt] at [2008-2-26]
# 1

You can enable word-wrap but I don't think the effect is terribly satisfying for code -- it's more intended for HTML and XML.

Displaying print margins is completely impossible. If you're looking to pretty-print your source code I recommend you search for a third-party solution as Visual Studio's printing feature is extremely rudimentary.

However, you can enable "editor guidelines" at a specific character position to help you wrap your code manually. Unfortunately, this requires a registry hack. Microsoft's Sara Ford posted the directions in her weblog:

http://blogs.msdn.com/saraford/archive/2004/11/15/257953.aspx

ChrisNahr at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# IDE...
# 2
hmm that's a shame. eclipse really shines with it's auto-formatting. can we expect something like that in the next releases of c# express?
thanks anyway :)
knallbunt at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# IDE...
# 3
I don't know if any enhancements are planned in this direction -- I already submitted a request to make those editor guidelines an "official" feature but MS replied that wouldn't make it into the next release.

You can submit any other feature requests you have at the Product Feedback Center, though:

http://lab.msdn.microsoft.com/productfeedback/

And here's my editor guidelines request, in case you want to vote for it:

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=0dbfada2-4dc3-4be9-9250-dd82b1504fe0

ChrisNahr at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# IDE...