【问题标题】:Don't format multiline 'If' statements to single line in Netbeans不要在 Netbeans 中将多行“If”语句格式化为单行
【发布时间】:2015-05-31 13:51:51
【问题描述】:

到目前为止,我已经在 google 上进行了搜索,但没有成功。是否可以将多行“if”语句的格式禁用为单行。我编写 PHP 代码并没有测试过 Netbeans 中的其他语言是否会发生这种情况。

原文:

if ($checkOne->very_long_function()
    || $checkTwo->you_dont_want_this()
    || $checkThree->in_one_line())

在 Netbeans 的默认格式之后,语句在一行中

if ($checkOne->very_long_function() || $checkTwo->you_dont_want_this() || $checkThree->in_one_line())

感谢您的帮助。

【问题讨论】:

    标签: php netbeans code-formatting


    【解决方案1】:

    前往

    "Tools" -> "Options" -> "Editor" -> "Formatting"
    

    选择“Wrapping”类别并向下滚动到“Wrap After Binary Operators”并检查它。

    Netbeans 将不再更改多行 if 语句。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-26
      • 1970-01-01
      • 2012-05-27
      • 2014-08-25
      • 2015-03-28
      • 2016-12-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多