I ran into an usability problem with a specific keyboard layout (b茅po, a French dvorak variant) and VSCode. The shift+space combination produces non-breaking spaces (U+00A0), and it is very easy to hit involuntarily when typing a space before or after a capital letter. This is not a problem itself, but it becomes one when a codebase is littered with invisible non-ASCII characters.
A simple fix in my case would be to show non-breaking spaces in an obvious way when editor.renderWhitespace is turned on. In 1.5.3 non-breaking space seems to be treated like a word character by renderWhitespace.
Emacs displays it even out of whitespace-mode with a bold colored underscore, and that can be done in Vim with listchars. As this does not look like a very complicated problem, I could submit it as a first PR to the project.
I checked, but if this has already been fixed or the discussion has already taken place, please feel free to close the issue.
P.S.聽: VSCode is an awesome piece of software and a pleasure to use, please keep up with the great work!
Steps to reproduce:
With the release of 1.6 and the new renderWhitespace settings, inserting a non-breaking space does not make the indentation after it invisible anymore, but the non-breaking space character itself is still invisible.
I have a similar issue as well, making non breaking space with alt+space (Slovenian Apple keyboard). Unfortunately it breaks almost every second class (SASS) I make, because I press alt too early.
Bump
I feel this would be useful even without renderWhitespace on: I suspect the majority of cases in which it appears in code, it's a mistake.
If anyone's interested in fixing it, I think it should be straightforward:
Also met similar problem when comparing two list of strings. the ​ --> Unicode Character 'ZERO WIDTH SPACE'(U+200B) is annoying.
List of more invisible characters & General Punctuation for your reference
| Symbol|Entity|HTML-code|Unicode|Name|
|---------|--------|-----------|---------|-------|
|聽| | |U+00A0|No-Break Space|
|颅|­|­|U+00AD|Soft Hyphen|
|鈥倈 | |U+2002|En Space|
|鈥億 | |U+2003|Em Space|
|鈥墊 | |U+2009|Thin Space|
|鈥墊 | |U+200A|Hair Space|
|鈥媩​|​|U+200B|Zero Width Space|
|鈥寍‌|‌|U+200C|Zero Width Non-Joiner|
|鈥峾‍|‍|U+200D|Zero Width Joiner|
|鈥巪‎|‎|U+200E|Left-To-Right Mark|
|鈥弢‏|‏|U+200F|Right-To-Left Mark|
Most helpful comment
I feel this would be useful even without
renderWhitespaceon: I suspect the majority of cases in which it appears in code, it's a mistake.If anyone's interested in fixing it, I think it should be straightforward:
https://github.com/Microsoft/vscode/blob/c15001e11d8a9a4a96f94deaceb70c3bc4259013/src/vs/editor/common/viewLayout/viewLineRenderer.ts#L319-L321
https://github.com/Microsoft/vscode/blob/c15001e11d8a9a4a96f94deaceb70c3bc4259013/src/vs/editor/common/viewLayout/viewLineRenderer.ts#L465-L487