How to display hidden characters by default (ZERO WIDTH SPACE ie. ​)

后端 未结 2 946
醉梦人生
醉梦人生 2020-12-12 10:26

I just lost part of my weekend because of this ... joker - zero width space. I just used some snippets from google groups and didn\'t recognize that there are doubled charac

相关标签:
2条回答
  • 2020-12-12 10:56

    Not sure what you meant, but you can permanently turn showing whitespaces on and off in Settings -> Editor -> General -> Appearance -> Show whitespaces.

    Also, you can set it for a current file only in View -> Active Editor -> Show WhiteSpaces.

    Edit:

    Had some free time since it looks like a popular issue, I had written a plugin to inspect the code for such abnormalities. It is called Zero Width Characters locator and you're welcome to give it a try.

    0 讨论(0)
  • 2020-12-12 10:58

    A very simple solution is to search your file(s) for non-ascii characters using a regular expression. This will nicely highlight all the spots where they are found with a border.

    Search for [^\x00-\x7F] and check the box for Regex.

    The result will look like this (in dark mode):

    0 讨论(0)
提交回复
热议问题