So, this:
cmd = new OdbcCommand( string.Format( @" SELECT * FROM Bobby_Tables WHERE Name = {0}", "Little Bobby Drop Tables" ), odbcConnection );
gets formatted to:
cmd = new OdbcCommand( string.Format( @" SELECT * FROM Bobby_Tables WHERE Name = {0}", "Little Bobby Drop Tables" ), odbcConnection );
I've looked at each of the options for line breaks and wrapping but I haven't been able to find the one to keep things on the same line as long as possible. I'm assuming that I missed the correct option. My Right margin (columns)
option is set to 100, which is plenty big.
Question: Is there a way to make it look like the original, and still get smart formatting on other things that actually do need to be wrapped?
I can manually put the
cmd = new OdbcCommand( string.Format ( @"
back on the first line and it'll leave the verbatim string on the next line happily. That's an alright compromise I guess.
Select the scope where you want to reformat code: Make a selection in the editor to reformat code in the selection. Set the caret anywhere in the file to reformat code in the file. Select one or more items in the Solution Explorer to reformat code in files under these items and their child items.
Use the line-continuation character, which is an underscore ( _ ), at the point at which you want the line to break. The underscore must be immediately preceded by a space and immediately followed by a line terminator (carriage return) or (starting with version 16.0) a comment followed by a carriage return.
I guess that your problem is that the first line got broken in three. This is because of bug http://youtrack.jetbrains.com/issue/RSRP-288271 that was fixed in ReSharper 7.0. You should consider upgrading or turning off option ReSharper | Options -> Code Editing | C# | Formatting style | Line breaks and wrapping -> LineWrapping | Wrap long lines
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With