M-q doesn't fill the very first line of a buffer. To reproduce, create a Go mode buffer with contents such as
// a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
// a a a a a
Even though the first line is longer than 70 columns, M-q doesn't refill the comment. Adding a line break before the first comment line will make this work as expected.
The underlying problem is that (go--fill-forward-paragraph -1) after or in the comment moves to the beginning of the second line instead of the first. I think the problem is that the (forward-line single) form can't move beyond the beginning of the buffer, and the loops in go--fill-forward-paragraph need to be adapted for this edge case.
M-q doesn't fill the very first line of a buffer. To reproduce, create a Go mode buffer with contents such as
Even though the first line is longer than 70 columns, M-q doesn't refill the comment. Adding a line break before the first comment line will make this work as expected.
The underlying problem is that
(go--fill-forward-paragraph -1)
after or in the comment moves to the beginning of the second line instead of the first. I think the problem is that the(forward-line single)
form can't move beyond the beginning of the buffer, and the loops ingo--fill-forward-paragraph
need to be adapted for this edge case.