tpope / vim-commentary

commentary.vim: comment stuff out
http://www.vim.org/scripts/script.php?script_id=3695
5.9k stars 214 forks source link

:Commentary! can only uncomment lines #150

Closed mg979 closed 3 years ago

mg979 commented 3 years ago

Closes #120.

For the cases that you have some enclosing if, try or similar and you comment them out to run the code inside, but then you want to uncomment them, without commenting again the whole block. Right now if there's some uncommented line in the range, it will comment again the commented lines.

tpope commented 3 years ago

Willing to give this a try I guess. Give s:go() a third parameter for the bang behavior. Your s: variable hack is not robust.

mg979 commented 3 years ago

Ok thanks, I tried that initially but it I couldn't make it work, now it does and the thing is much smaller.