开发者

Vim NERD-Commenter: How to uncomment only first level of comments, without uncomment nested comments?

I got a problem with NERD-commenter.

If I <leader>cu the following code:

/*function func(arg) {
    codeish;  // Nested comment.
}*/

This is the result:

function func(arg) {
    codeish;  Nested comment.
}

Note the 2nd line: The nested comment was also uncommented. This is not good.

Perhaps I'm just not using it right. How can I开发者_运维问答 avoid this?


Well, if you're the one who has commented out the function, you can avoid it by using <leader>cc to comment it out in the first place. In this way, the function will get commented out in a different way, and subsequent <leader>cu will work as expected.

If, however, you want to use NERD Commenter to uncomment blocks of code which have been commented out manually (or using a different tool), I don't know how would you go about it. After all, the cc and cu commands are meant to be reciprocal.


This bug was fixed in the latest version of NERD-Commenter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜