Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document <Plug>TComment_ic #188

Open
nkgm opened this issue Apr 12, 2017 · 2 comments
Open

Document <Plug>TComment_ic #188

nkgm opened this issue Apr 12, 2017 · 2 comments

Comments

@nkgm
Copy link

nkgm commented Apr 12, 2017

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?

@nkgm
Copy link
Author

nkgm commented Apr 12, 2017

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; |)}># */

@dawaltconley
Copy link

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.

atomictom added a commit to atomictom/tcomment_vim that referenced this issue Dec 30, 2019
This addresses tomtom#255 and
tomtom#188. It also partially
addresses tomtom#237 (by making
it clear that the functionality exists, even if it doesn't quite do
what's being asked for there).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants