Eclipse: I turned on hidden characters now I can't turn off

前端 未结 15 1546
臣服心动
臣服心动 2020-11-28 09:18

Somehow I\'ve turned on hidden characters in Eclipse. It\'s not the \"whitespace\" characters in the general editor preferences. When turned on, it adds another layer of hid

相关标签:
15条回答
  • 2020-11-28 09:42

    Go to Preferences > General > Editors > Text Editors and restore defaults.

    0 讨论(0)
  • 2020-11-28 09:43

    It is actually in two places...

    Sandkastenliga points out the obvious one, but you can also show white space with a shortcut key combination. The key combination is separate from the text editor preferences and will superimpose additional characters when active (it uses \r and \n for carriage return an line feed respectively instead of the symbols used by the text editor preference.)

    Go to preferences > general > keys and look for the binding for the 'Show Whitespace' command.

    I have the text editor preference turned on, so I removed the binding for this command altogether (it was set to Ctrl+. in my profile) to prevent accidental activation as it doesn't affect the other preference.

    0 讨论(0)
  • 2020-11-28 09:46

    It is under Preferences > General > Editors > Text Editors. There is a checkbox labeled "Show whitespace characters". If you uncheck this the editor switches back to normal.

    If you click on the "whitespace characters" link in this line you will get a popup window, in which you can define which characters eclipse is supposed to consider as whitespace characters.

    In this popup window you also get the option to define the transparency in which each whitespace character is displayed in the editor, which you can use to (indirectly) change their foreground colour. I'm just mentioning it here, because it took me about half an hour to find this setting! ;-)

    0 讨论(0)
  • 2020-11-28 09:46

    There is a toggle button 'Show Whitespace Chars' on the Eclipse toolbar

    screenshot of toolbar showing the Show Whitespace Characters button

    0 讨论(0)
  • 2020-11-28 09:47

    You can add "Show Whitespace Characters" button in toolbar by customizing your perspective. It also contains buttons to toggle word wrap, and toggle selection mode.

    Go to Window > Perspective > Customize Perspective > Action Set Availability, then select "Editor Presentation" action set:

    This works in Eclipse Neon.

    You can also add a key binding for this action. Go to Preferences > General > Keys > "Show Whitespace Characters"

    0 讨论(0)
  • 2020-11-28 09:48

    I am using Eclipse Oxygen and can see this option to toggle whitespace characters:

    0 讨论(0)
提交回复
热议问题