Hello Pelle,
There is a bug in Comment and Uncomment functionnality.
Paste this piece of code:
int main(int argc, char *argv[])
{
printf("The Begining\n");
for (i = 0; i < 10; i++) {
// Comment
printf("i : %d", i);
}
printf("The End!\n");
return 0;
}
Now select text from "The Begining" to "The End" and Comment the selected text.
You should have:
int main(int argc, char *argv[])
{
// printf("The Begining\n");
// for (i = 0; i < 10; i++) {
// Comment => No comment has been added
// printf("i : %d", i);
// }
// printf("The End!\n");
return 0;
}
Now uncomment the same block.
You should have:
int main(int argc, char *argv[])
{
printf("The Begining\n");
for (i = 0; i < 10; i++) {
Comment => The comment has disappeared
printf("i : %d", i);
}
printf("The End!\n");
return 0;
}
Could you correct this bug.
Thank you and have a nice day.
It's actually designed this way, so I will not classify it as a bug. Perhaps change the behaviour, but there are some reasons for this... (I think...)
Maybe. I will think about it...
It is a strange behavior in my opinion.
It should be more logical (always in my opinion) to comment the block like this
int main(int argc, char *argv[])
{
// printf("The Begining\n");
// for (i = 0; i < 10; i++) {
// // Comment
// printf("i : %d", i);
// }
// printf("The End!\n");
return 0;
}
Like that, if you have to uncomment the block, you simply have to delete all //
Don't you think it would be better like that?
This last is the way Microsoft Visual Studio does it.
I agree with this form of comments. When you comment out something that is already slashed, comments should double (just add two bars at the beginning and be careless about the current contents of the line).
I think it's all about what you are customed to, but not putting in slashes when they already exist, can produce wrong code when you get slashes out; double comments are harmless.