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

Support commenting less than line #142

Open
DoDoENT opened this issue Apr 26, 2021 · 1 comment
Open

Support commenting less than line #142

DoDoENT opened this issue Apr 26, 2021 · 1 comment

Comments

@DoDoENT
Copy link

DoDoENT commented Apr 26, 2021

For example, gcw should comment only the next word. Also, if less than line is selected in visual mode, gc should comment out only the selection.

For example, consider this code:

void function( unsigned int var, unsigned char & errorCode );

After selecting only the errorCode word and pressing gc, or after positioning the cursor at the beginning of errorCode word and pressing gcw, the following state is expected:

void function( unsigned int var, unsigned char & /* errorCode */ );

However, I get the following:

// void function( unsingned int var, unsigned char & errorCode );

Note: I've setup // for line comments in c-like languages that support it with following .vimrc entry:

autocmd FileType cpp,hpp,ts,js,java,cs,groovy setlocal commentstring=//\ %s

However, I get the same wrong behaviour even if I set commentstring to /*\ %s\ */ (the entire line gets commented instead of just the selection).

@rsynnest
Copy link

Discussed in #10

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