microsoft / vscode

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

editor.renderWhitespace should have option for selection+trailing #106697

Open tigerhawkvok opened 4 years ago

tigerhawkvok commented 4 years ago

Right now you're limited to picking between selection (old) or trailing (new), but if you want both behaviours you're out of luck.

There should be an option allowing both to be true.

vscodebot[bot] commented 4 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

amomchilov commented 4 years ago

Yeah, it was a mistake IMO to model these as a single value. Should be a series of checkboxes, e.g:

hika-ru commented 2 years ago

Are there any news on this one? I'd love to have it fixed for use in markdown editing 🙂.

tuxcomputers commented 2 years ago

Yeah, it was a mistake IMO to model these as a single value. Should be a series of checkboxes, e.g:

* Render trailing whitespace

* Render leading whitespace

* Render all whitespace in selection

* And one for the "boundary" option, which I frankly don't even understand.

Boundary is trailing + leading + more than single space within the text. This is boundary, the red arrow is the whitespace rendering for more than single space Screenshot_1404

If it was a series of checkboxes it would solve my request, I want boudary without the last one, I could just tick leading and trailing.

timidak commented 2 years ago

Hi, I would like to implement this.🖐️

In my opinion, you could model this with an array of strings (corresponding to the options) or an object with the options as keys and booleans as values. Feel free to suggest other ways.🙂

Also, are there any other requirements from the core contributors?

laurentlb commented 2 years ago

I like the suggestions above, but I'm not certain the VS Code team would be happy with a bunch of checkboxes. As an alternative, we could:

  1. Remove the Selection option from the Editor: Render Whitespace enum
    • New options could be added if needed, e.g. Leading + Trailing
  2. Introduce a separate setting, e.g. "Render whitespace when selected"

I feel like the "selected" option is distinct enough that it deserves its own setting.

Would a PR be accepted for this?

injust commented 4 months ago

Bumping this as it seems like it's been forgotten

torzod commented 1 month ago

any updates on this feature? would be very useful for me and evidently many others, thanks!