How to display hidden characters in PhpStorm, especially line seperators

岁酱吖の 提交于 2019-12-22 06:37:00

问题


I got some special characters in my codes, take a look at:


 a


 
 


It's just shown in frontend with normal characters like an "a". Now the same characters without any normal characters:

Characters starts here








Characters ends here

Ok it looks like this Editor will not save empty 
 , try it with snippet.

<html><p>
    </p></html>

The problem is, in PhpStorm this characters wont be shown, even not with

"settings - Editor - General - Appearance - show whitespaces" or

"settings - Editor - General - Appearance - show method separators"

Only "strg+f, strg+r" will find this characters.

I think this character is an "only-mac-char" :) I'm working with Windows, and I can't test it on mac.

EDIT: Sorry i could identify it as "U+2028 : LINE SEPARATOR" http://www.babelstone.co.uk/Unicode/whatisit.html

The big problem is that phpStorm didn't show anything in the code. Like there is no character, but moving with the arrow keys notice 2 steps at this position, between 2 tags looks like "><" but it's "> <".


回答1:


Based on your update it is now clear what character you have in mind:

Sorry I could identify it as "U+2028 : LINE SEPARATOR" http://www.babelstone.co.uk/Unicode/whatisit.html

Install and use Zero Width Characters locator plugin-- it can detect quite few invisible characters (e.g. UTF-8 BOOM sequence, non-breakable space, Unicode line separator (your case) etc).

It is implemented as separate inspection with highest (Error) severity so will be easy to spot or check whole folder/project just for these issues.


There is a ticket (Feature Request) to have an option to show invisible characters in editor.

https://youtrack.jetbrains.com/issue/IDEA-115572 -- watch this ticket (star/vote/comment) to get notified on any progress.

Other related tickets:

  • https://youtrack.jetbrains.com/issue/IDEA-99899 (your case, as I understand)
  • https://youtrack.jetbrains.com/issue/IDEA-140567
  • https://youtrack.jetbrains.com/issue/WEB-13506


来源:https://stackoverflow.com/questions/41298042/how-to-display-hidden-characters-in-phpstorm-especially-line-seperators

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!