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

Fix comment filling at start of buffer. #374

Closed muirdm closed 3 years ago

muirdm commented 3 years ago

In cases like:

// Sweet
// comment.
package foo

We weren't filling the comment properly because (go--fill-forward-paragraph -1) was ending up on the second line instead of the first. It goes backwards to the first line with no comment content and then moves forward one line, but at the beginning of the buffer there is no line preceeding the comment. Tweak the logic to not move forward if the current line has comment content.

Fixes #373.