vim-solidity icon indicating copy to clipboard operation
vim-solidity copied to clipboard

Improve handling of comments and doc comments

Open wchargin opened this issue 4 years ago • 3 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 avatar May 03 '21 01:05 wchargin

@wchargin how about also accommodating the /**.. **/ natspec style? ;)

chanhosuh avatar Jul 11 '21 18:07 chanhosuh

@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.

wchargin avatar Aug 16 '22 02:08 wchargin

Hey @wchargin, I merged this PR in our maintained fork!

mhluongo avatar Sep 26 '22 18:09 mhluongo