dominikh / go-mode.el

Emacs mode for the Go programming language
BSD 3-Clause "New" or "Revised" License
1.37k stars 209 forks source link

Improved heuristic to stay in place after gofmt #357

Closed phikal closed 3 years ago

phikal commented 4 years ago

The current logic after gofmt just returns to the column, which I have found to be annoying, if the line was changed before the point. I have tried to implement a heuristic that keeps the point on whatever it was editing. It's not prefect, so it quite liberally falls back onto the older mechanism. It also keeps the point in the column, in case the line is erased by gofmt.