问题描述
所以,这样的:
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 );
我看着每个换行和包装的选择,但我一直没能找到一个使事情在同一行上尽可能长。我假设我错过了正确的选项。我的右页边距(列)
选项设置为100,这是很多大
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?
我可以手动把
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.
推荐答案
我猜你的问题是,第一行得到了在三级破碎这是因为错误的被固定在ReSharper的7.0,你应该考虑升级或关闭选项 ReSharper的|选项 - >代码编辑| C#|格式风格|换行和换行 - 方式> LineWrapping |回绕长行
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
.
这篇关于ReSharper的换行符和包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!