Visual Studio Code Not Displaying Invisible Characters/Spaces

1.6k Views Asked by At

I am currently working on writing code for a Source Game Engine map file. I have issues with Visual Studio Code not displaying certain invisible characters.

When using notepad++, I can see there are invisible characters in between the lines: When using notepad++, I can see there are invisible characters in between the lines

But when I open it up in visual studio code, it's as if the invisible character doesn't exist.

This is what I see when using visual studio code: This is what I see when using visual studio code

I have asked my friends who also do the same thing (making Source Engine Maps) and they all don't have this issue. One of my friends sent me this image:

This is what he sees in his own editor, with squares representing the invisible character/space: This is what he sees in his own editor, with squares representing the invisible character/space

I've done a few things to try to fix this issue:

  • Changing fonts (I used a custom font but reset to default to see if it had any impact)
  • Changing encoding setting (UTF-8 was what my friends used but I tried tinkering around)
  • Changing editors (Tried Atom/Sublime but only Notepad++ even shows there being an invisible character)
  • Updated / reinstalled language packs
  • Enabling whitespaces

After everything, I still have the same issue. Are there other possible fixes/causes for this issue?

2

There are 2 best solutions below

0
On

I myself, went through this and all I did was:

-> Open Settings(ctrl+,)

-> You will find an icon (settings(JSON))

-> locate this:

"editor.unicodeHighlight.allowedCharacters": {
    " ": true
}

-> change it to:

"editor.unicodeHighlight.allowedCharacters": {
    "": false
}

-> restart application

have a look

I could able to spot now

0
On

Fixed
I just had to enable Render Control Characters in visual studio code.