tcomment_vim icon indicating copy to clipboard operation
tcomment_vim copied to clipboard

`gc` does not uncomment if only one line is selected and the comment symbol is at the begining of a line

Open albertas opened this issue 5 years ago • 4 comments

When I block select only one line and try to uncomment it by using gc in .py files, it gets commented again, instead of uncommented if comment symbol is at the begining of a line. This behaviour also applies for other file types too.

albertas avatar Jan 10 '20 10:01 albertas

Also experiencing this.

haze avatar Sep 12 '21 14:09 haze

I would love to see this fixed. Would do myself, if I knew vimscript.

albertas avatar Sep 12 '21 14:09 albertas

Could you please be more specific and provide an example?

With "block select" you mean $. This could cause some confusion.

Why would you want to "block select" a single line?

tomtom avatar Sep 13 '21 05:09 tomtom

My use case is in Python, I have several imports:

import time
import os

I visually select first import line by clicking shift+v and comment it with gc.

# import time
import os

Some time passes and I want to uncomment that line, so go on it, click shift+v and gc and the result is another comment instead of uncommented line:

# # import time
import os

Why do I use this combination? I got used to using gc for toggling comments disregarding the size of code block. The same applies for .vimrc edits - sometimes I want to toggle commenting for a single line.

albertas avatar Sep 13 '21 05:09 albertas