microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.9k stars 29.52k forks source link

editor.unicodeHighlight.ambiguousCharacters and editor.unicodeHighlight.invisibleCharacters do not correctly work only when opening VSCode #233503

Open adusamr opened 3 weeks ago

adusamr commented 3 weeks ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Copy and paste below text and save it as test.md (they are not usual ASCII characters)
    ABC DEF
  2. Close VSCode while opening test.md
  3. Open VSCode, then you see ABC DEF is highlighted
  4. Close 'test.md' (don't close VSCode) and reopen test.md
  5. ABC DEF highlight disappears

defaultSettings.json is like this:

{
    "editor.unicodeHighlight.ambiguousCharacters": true,
    "editor.unicodeHighlight.invisibleCharacters": true,
    "[markdown]":  {
        "editor.unicodeHighlight.ambiguousCharacters": false,
        "editor.unicodeHighlight.invisibleCharacters": false,
    }
}

ABCDEF are ambiguous characters and the space   is invisible character. So in .md file, ABC DEF should not be highlighted.

I posted another issue https://github.com/microsoft/vscode-docs/issues/7773 regarding overwriting these settings in user settings. I don't know it is relating to this issue.

RedCMD commented 3 weeks ago

related microsoft/vscode#231224