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

Can't uncomment a wrapped portion of a line #26

Closed
bounceme opened this issue Jun 24, 2015 · 10 comments
Closed

Can't uncomment a wrapped portion of a line #26

bounceme opened this issue Jun 24, 2015 · 10 comments

Comments

@bounceme
Copy link

The plugin can wrap some of a line from visual mode but can't uncomment it.

@tyru
Copy link
Owner

tyru commented Jun 26, 2015

Please give me more details.

@bounceme
Copy link
Author

When you make a wrapped comment using a visual selection that isn't a full line,or is several lines where there is some unincluded text at either end,you can't unwrap that comment it seems. I've tried with both the gcuw and the gcuu maps in both visual and normal modes.

@tyru
Copy link
Owner

tyru commented Mar 18, 2016

@bounceme I can't reproduce this.
Please tell me the followings.

  1. &filetype while making a wrapped comment
  2. example source code
  3. steps to reproduce

@tyru
Copy link
Owner

tyru commented Mar 18, 2016

And sorry for delay to reply... ;(

@tyru tyru added the bug label Mar 18, 2016
@tyru
Copy link
Owner

tyru commented Mar 18, 2016

I tried to reproduce in filetype=c.

Code

    /* printf("hello\n"); */
    printf("hello\n");

Steps to reproduce

  1. Select above 2 lines using V command.
  2. Type gcuw

Above steps change current buffer like below

    printf("hello\n");
    printf("hello\n");

@tyru
Copy link
Owner

tyru commented Mar 18, 2016

the gcuu maps

Hm, what keymapping do you mean?
caw.vim doesn't provide such default keymapping.

@bounceme
Copy link
Author

Hey, thanks for getting to this issue. you can use visual mode to select just the word "hello", then press "gcw" which comments out the selected word. The issue is that using any keycap from this plugin won't uncomment that word in the middle of the line.I don't really find this to be a very important problem though

@tyru
Copy link
Owner

tyru commented Mar 20, 2016

Okay, now I understand.
I will implement gcuw in a wrapped portion of a line.

gcw (comment) currently working

[...] is selected range.

int one_or_two = 1;
if (one_or_two == 1) {
} else [if (one_or_two == 2)] {

to

int one_or_two = 1;
if (one_or_two == 1) {
} else /* if (one_or_two == 2) */ {

gcuw (uncomment) currently not working

In wrap comment and while normal-mode:

} else /* if (one_or_two == 2) */ {

to

} else if (one_or_two == 2) {

@tyru
Copy link
Owner

tyru commented Mar 14, 2020

Concise example (from #84)

Expected

Typing <Plug>(caw:wrap:uncomment) in comment string

int i = /* 1 ? 2 : */ 0;

results in

int i = 1 ? 2 : 0;

Got

Typing <Plug>(caw:wrap:uncomment) in comment string does not change anything.

int i = /* 1 ? 2 : */ 0;

@tyru
Copy link
Owner

tyru commented Mar 24, 2020

Fixed in #118

@tyru tyru closed this as completed Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants