Improve handling of comments and doc comments
Doc comments are now properly formatted with gq and J. For example,
on this input text:
/// one
/// two
pressing J on the top line used to result in /// one / two, and now
results in /// one two. Conversely, on this input text:
/// this long line exceeds the text width
pressing gqgq with a textwidth of 20 now yields:
/// this long line
/// exceeds the text
/// width
instead of:
/// this long line
//exceeds the text
//width
Furthermore, adding a new line to an existing comment, by pressing o
in normal mode or Enter in insert mode, now automatically inserts the
appropriate comment leader (// or ///).
wchargin-branch: comment-doc-and-leader
@wchargin how about also accommodating the /**.. **/ natspec style? ;)
@wchargin how about also accommodating the
/**.. **/natspec style? ;)
Go for it! I personally don't use that natspec style and am not super familiar with this corner of Vim config, so I'm not going to implement this myself.
Hey @wchargin, I merged this PR in our maintained fork!