1.File --> Setting --> Editor --> General --> Virtual Space --> All placementof caret after end of line 取消勾选
2.File --> Setting --> Editor --> General --> Other --> Strip trailing spaces on Save 选择 Modify Lines
3.File --> Setting --> Editor --> General --> Other --> Always keep trailing on create line 取消勾选
--> Apply --> Ok