microsoft/vscode

Provide editor.renderWhitespace "selection" option

OlsonDev opened this issue Β· 30 comments

Sublime Text has the option:

    // Set to "none" to turn off drawing white space, "selection" to draw only the
    // white space within the selection, and "all" to draw all white space
    "draw_white_space": "selection",

I would like to see selection added to list of possible values for editor.renderWhitespace. I find it incredibly useful.

While writing code, I prefer to not show whitespace. However, when I copy-paste code snippets, I like to know the whitespace matches the target document by simply selecting it (usually via Ctrl+A), not using the arrow keys or toggling a setting.

Thanks

elad commented

I feel bad commenting "+1" on this issue, especially after the open letter to GitHub, but there's no other way of letting you know how important this is to me without doing so. So +1. :)

50 thumb ups atm, multiple duplicates, but no no movement on this for a year? Seems like a low hanging fruit ripe for the picking to me. Anybody?

Hopefully this will be added in the next release!

mignz commented

Taking a while... :(

This seems to be the main issue that is being tracked for this. Any update on when we can expect to see this feature in a future release?

It would be great to have this, since it's valuable to know whitespace status in various cases including linting.

+1

While we wait, I have create an extension explicitly for this issue. Please take a look.

chmln commented

Shameless plug

For those who want sublime's tab+space rendering

see https://marketplace.visualstudio.com/items?itemName=chmln.better-whitespace

@chmln I don't want to inform about this for the sake of installation numbers on my extension but I believe you just derived my work there. Although I didn't specified any license in my repository. GitHub's default license for unlicensed repository is as followed...

screen shot 2560-04-24 at 08 36 07
(ref: Licensing a repository)

If you believe that it's totally all your hard work, could you prove it that it's yours?

If you just want to do a variant implementation, you could just PR on my extension as your extension do most things the same way as mine do.

chmln commented

@spywhere I wouldn't like to derail this thread now and spam inboxes of all those who are subscribed here. Let's talk about it elsewhere

I just wanted to share a quick dirty hack:

	"editor.renderWhitespace": "all",
	"workbench.colorCustomizations": {
		"editorWhitespace.foreground": "#ffffffff" // <-- use here the theme's background color
	}

It isn't really the same, but not super bad either:
1477

Stuk commented

In addition to the above, I had to set editorIndentGuide.background so that my indent guides didn't disappear too (with Oceanic theme):

    "workbench.colorCustomizations": {
        "editorWhitespace.foreground": "#1B2B34", // theme background
        "editorIndentGuide.background": "#65737E" // indent guide color
    }

Hello,
Does exist any chance to add this small feature in future releases?
Really small option, but need to use whole extention for that.
A lot of thanks to @chmln for it

+1 That would be so much useful!

It has been moved back several times now ...!
@ramya-rao-a when will it actually be included?

Yet another +1

While the boundary setting is nice, having a proper selection render would be truly ideal, definitely support this too! +1

This is especially useful when collaborating who aren't very pedantic when it comes to whitespace. +1

+1

+1

Any news?

Until this is not fixed, we can use:
https://marketplace.visualstudio.com/items?itemName=spywhere.whiteviz
Anyway, i think VS Code Team should make it in standard

thank @kanlukasz :)

Otiel commented

Until this is not fixed, we can use:
https://marketplace.visualstudio.com/items?itemName=spywhere.whiteviz

Any advantage compared to using the tip shared by @alexandrudima?

	"editor.renderWhitespace": "all",
	"workbench.colorCustomizations": {
		"editorWhitespace.foreground": "#ffffffff" // <-- use here the theme's background color
	}

1477

Any advantage compared to using the tip shared by @alexandrudima?

In this plugin you have some extra options, for example - changing this arrows to a straight long lines

Edit:

There is one small visual error in this plugin - spywhere/vscode-whiteviz#10

The setting will be available in tomorrow’s VS Code Insiders, which you can download here if you want to try it out: https://code.visualstudio.com/insiders/. It will be part of our next release in August. Thanks!

Nice job! I'll update the extension to encourage this change accordingly then. πŸ˜„