【发布时间】:2011-06-20 10:00:21
【问题描述】:
我目前在自动缩进跨越多行的 PHP 数组时遇到了困难。标准 TextFX > TextFX Edit > Reindent C++ Code 在这里失败。
例如取如下代码sn-p:
<?php
$something = array(
"test" => $var,
"nested" => array(
"subnest" = array(
"low" => "yes",
"foo" => "bar",
),
"bar" => "baz",
),
"last" => "yes",
);
运行“Reindent C++ Code”并得到这个:
<?php
$something = array(
"test" => $var,
"nested" => array(
"subnest" = array(
"low" => "yes",
"foo" => "bar",
),
"bar" => "baz",
),
"last" => "yes",
);
并不是我真正想要的。
我是否缺少任何可以在 Notepad++ 中正确缩进 PHP 数组的工具或插件?
【问题讨论】:
-
使用 Netbeans netbeans.com
-
这到底是怎么回事? IDE 问题长期以来一直被问到 SO。看看notepad++标签就行了。
-
@Petah 虽然我喜欢 Netbeans,但很多时候我需要一些更轻的东西。
-
您要使用哪种格式?就像在你的代码 sn-p 中一样,或者...?
-
@bob-the-destroyer 我在让 Np++ 正确缩进这段代码 sn-p 之后(第一个实际上是我所追求的,但 Np++ 像第二个一样重新格式化它)。问题在于大型 PHP 文件中的所有缩进都正确,除了这个,阻止我一直使用它。