vscode-stretchy-spaces
vscode-stretchy-spaces copied to clipboard
Whitespace characters stretch incorrectly with proportional-width fonts.
I'm using the following settings:
"editor.fontFamily": "Arial",
"editor.renderWhitespace": "selection",
"stretchySpaces.targetIndentation": 6,
To reproduce, just make a selection.
The "whitespace character" (the dot that's used to indicate a space) in Arial is a different size than actual spaces, so text moves around as the selection changes.
Is there a way in CSS to represent "the width of the space character"?
Oh hah, I guess that's actually a separate issue -- using ch isn't accurate for a proportional font.
It seems that VSCode normally explicitly sets the width of those whitespace characters in a selection to make them the same size as a space, but that doesn't happen with this extension enabled.
Here's an example of this bug in action. Notice how the line after the selection is shifted a few pixels to the right.

Here's a span element that represents the selection of one space without this extension enabled.

And, with the extension. The computed width is missing.

It's probably worth mentioning... stretching spaces to match some target tab size is not actually why I'm trying out this extension.
Spaces in proportional-width fonts are much narrower than other characters. What I really want is an extension that makes every indentation space exactly 1ch in width.