File menu -> Settings -> Editor -> Virtual Space and uncheck 'Allow placement of caret after end of line'.
Also uncheck the other options in the Virtual Space panel.
If you want to remove trailing whitespaces, you can do
File menu-->Settings --> Editor --> Strip Whitespaces on Save to either "All" or "ModifiedLines".
Also uncheck the other options in the Virtual Space panel.
If you want to remove trailing whitespaces, you can do
File menu-->Settings --> Editor --> Strip Whitespaces on Save to either "All" or "ModifiedLines".