dongwuchu0314 2016-02-20 17:58
浏览 124
已采纳

PhpStorm没有正确地重新格式化完整的代码

Since I have many (bad coded/indented) files, that look like this: enter image description here

After doing a reformat, most code is indented right, but some parts still look like this: enter image description here

After having a closer look (with sublime) I noticed that these lines are not indented with tabs, but with spaces: enter image description here

So why are those parts not indented right with tabs?

Additional question: How can I remove the empty lines for the hole project?

  • 写回答

1条回答 默认 最新

  • dsqbh42082 2016-02-20 22:06
    关注

    The issue with spaces instead of tabs and original indentation -- you need to remove span from the "Keep white spaces inside" list in Code Style for HTML.

    Empty lines -- most of them you can get rid if you disable "Keep line breaks" sort of options and put 0 into "Maximum black lines" kind of fields -- there quite a few of them in each language (HTML & PHP in your case).

    Unfortunately those options do not seem to have any effect on empty lines between PHP code blocks (between '?> and <?php). For such cases I suggest use regex and replace (2 line endings in a row) by single (you may need to run such replacement few times if you have lots of consecutive empty lines).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序