user3761308
user3761308

Reputation: 791

Show whitespace only on selected text in IntelliJ IDEs?

Like how it is in Sublime Text. Currently I've only found the ability to show whitespace permanently.

Upvotes: 15

Views: 4855

Answers (2)

Bas Leijdekkers
Bas Leijdekkers

Reputation: 26482

Since version 2023.1 there is an option to enable this in the settings under Preferences | Editor | General | Appearance.

Screen shot of the Show Whitespaces setting

For older version an interesting trick to get the desired effect has been posted in the feature request.

  1. Enable Show whitespaces in File | Settings | Editor | General | Appearance
  2. Set the Text | Whitespaces foreground color to be the same as the editor background color in File | Settings | Editor | Colors & Fonts | General

Result: Whitespace is invisible by default, but when the text is selected the background color will change and the whitespace becomes visible.

Upvotes: 34

LJ replica
LJ replica

Reputation: 736

In IDEA 2023.1, there is an option in Settings | Editor | General | Appearance | Show whitespaces | Selection for it.

Upvotes: 3

Related Questions