tcomment_vim
tcomment_vim copied to clipboard
Document <Plug>TComment_ic
https://github.com/tomtom/tcomment_vim/blob/master/plugin/tcomment.vim#L198-L199
Recently tried to use the ic
textobj for a different mapping only to find out it is already being used, but it's not clear what it does. As a visual operator it appears to select text backwards on the same line until the commentstring
inclusive (observed on .vim style comments). Is this the intended behavior?
I can see the intent in C and Javascript inline comments. Wondering if it's be possible to have the same behavior for line comments - ie highlight the entire line.
Going off tangent, I noticed you can't toggle an inline comment if it's at the end of a line:
https://github.com/tomtom/tcomment_vim/blob/master/spec/tcomment/issue30_test_2.c
return 0 /* ac; */
Running vic<C-_>
gives:
return 0 /* #<{(| ac; |)}># */
I also think this should be documented, but honestly I just don't like it. It diverges from the normal text object pattern, where i
stands for inner, as opposed to "inline." I would expect an ac
object where there was an ic
, but there isn't one in this case. This also means it conflicts with other plugins for comment text objects, where ic
does mean "inner comment." Plus it behaves strangely in many languages.