Search code examples
gogoland

Automatic transfer of cursor in GoLand IDE during switching tabs


I have one problem. When I type something in GoLand IDE and switch, for example, to Chrome, and then back to GoLand IDE, if I had cursor on empty line, after Chrome I had this cursor on another line, how to take off of this?

I searched and try many methods, but anything works.


Solution

  • Most likely, GoLand saves the file after you switch to another application and invokes gofmt formatter or Actions on Save under the hood that strips lines/spaces.

    Try to turn off Settings | Tools | Actions on Save or Save files when switching to a different application or a built-in terminal in Settings | Appearance & Behavior | System Settings. The latter option is not the safest solution, so I recommend disabling Actions on Save in that case.