How do I auto-remove trailing whitespace in Androi

2019-01-23 22:54发布

Similar to the question for eclipse,

  • How can I auto-remove trailing whitespace from the entire file being edited?
  • How can I auto-remove trailing whitespace only from the lines I changed?

2条回答
The star\"
2楼-- · 2019-01-23 23:05

Ha, it's as simple as Code->Reformat code... (option-cmd-L)

查看更多
甜甜的少女心
3楼-- · 2019-01-23 23:11

You can also enable it on save via the following preference (Editor -> General -> Other):

enter image description here

And for those wondering,

"Always keep trailing spaces on caret line"

If this option is selected, trailing spaces will not be stripped on the line where the caret is placed on save operation (for example, when you switch to another window).

(bigger image)

查看更多
登录 后发表回答