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

[feature error] commenting on a block of C which already has comments messes up the comments #25

Open
qvieth opened this issue Jul 21, 2021 · 4 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@qvieth
Copy link

qvieth commented Jul 21, 2021

aa

@terrortylor
Copy link
Owner

Hi, you'll probably want to take a look at these two config values: (see readme for details on their purpose)

  • marker_padding = true
  • comment_empty = false

If you are still having issues can you provide details on how to replicate, with example file and key presses?

@qvieth
Copy link
Author

qvieth commented Jul 23, 2021

Screencast.from.07-23-2021.09_05_28.PM.mp4

@terrortylor Tried you config, but the issue still happens

Also in this video I have to type gc 3 times before the actual comment show up(nothing happens at the first gc and second gc)(should i open another issues for this?)

Here's the block of code I tried to comment :

#include <stdio.h> 
#include <string.h>
/* a function power(m,n) to raise an integer m to a positive integer power n */
int main(int argc, char *argv[]) {
  char *a = "hello, how are you, i miss you alot";
  printf("%s", a);
}

after commenting :

/* #include <stdio.h>  */
/* #include <string.h> */
/* /* a function power(m,n) to raise an integer m to a positive integer power n */ */  <-- THIS */ BREAK THE CODE (gcc throws error when compiling the file)
/* int main(int argc, char *argv[]) { */
/*   char *a = "hello, how are you, i miss you alot"; */
/*   printf("%s", a); */
/* } */

expected behavior -> like tpope/vim-commentary 's behavior :

/* #include <stdio.h>  */
/* #include <string.h> */
/*  /1* a function power(m,n) to raise an integer m to a positive integer power n  *1/ */ <- The *1/ makes the C code not being broken
/* int main(int argc, char *argv[]) { */
/*   char *a = "hello, how are you, i miss you alot"; */
/*   printf("%s", a); */
/* } */

@qvieth
Copy link
Author

qvieth commented Jul 25, 2021

Also in this video I have to type gc 3 times before the actual comment show up(nothing happens at the first gc and second gc)(should i open another issues for this?)

@terrortylor changed my timeoutlen to 500 fix the "typing gcc or gc don't work” issue above(the video above has my timeoutlen=200, I think that mess up with the typing somehow idk)

@terrortylor
Copy link
Owner

Thanks for the update.

I can replicate... I wasn't planning on doing nested comments... but this would annoy me.
Bit strapped for time atm, but I'll have a think and see what I can do.

@terrortylor terrortylor added bug Something isn't working enhancement New feature or request labels Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants