【发布时间】:2017-07-19 12:28:00
【问题描述】:
我一直在使用自定义快捷方式来缩进这篇文章中提到的 Sublime Text Indent multiple lines in Sublime Text
但如果有奇数个空格,它就不起作用。就像我的制表符大小设置为 2 个空格一样,当任何行的开头有 3 个空格时,它不会缩进剩余的代码。
例如:
<?php
function test_indent() {
if (condition) {
echo "here";
}
else {
echo "else";
}
}
当我使用上面帖子中指定的自定义快捷方式缩进时,即:
{ "keys": ["ctrl+shift+f"], "command": "reindent", "args": {"single_line": false} }
对我来说,结果如下:
function test_indent() {
if (condition) {
echo "here";
}
else {
echo "else";
}
}
我需要做什么才能使其正确缩进?
【问题讨论】:
-
在玩这个的时候,我发现如果你首先完全
unindent你的文件,reindent将按预期工作 -
我完全同意你的看法。但应该有更好的解决方案。
-
这种行为似乎会影响多种类型的文件——不仅仅是 PHP
标签: php editor sublimetext2 sublimetext3 indentation