Vim
Vim copied to clipboard
[n]gc does comment out n+1 lines instead of n.
Describe the bug [n]gc does comment out n+1 lines instead of n.
To Reproduce Steps to reproduce the behavior:
create a file with following python file (if it is txt gc will not work):
def test():
print('a')
print('b')
print('c')
print('d')
go to the line with print('b') Switch into normal mode in the middle of the file. 2gc<Down>
Expected behavior gc would comment out two lines.
What happened instead ? gc commented out 3 lines
Vim for VSCode version: v1.27.2
I can't reproduce the problem you described. Actually, I need to use [n]gcc to comment n lines, [n]gc simply does nothing.
Maybe you're using a custom keymapping or something...?
Sorry i forgot that you need to use a direction. It is 2gc<DOWN ARROW>
Sorry i forgot that you need to use a direction. It is 2gc
What do you mean? As stated above, 2gc doesn't do anything, and 2gcc works fine for me.
Go into one of the first lines and try 2gc[Arrow Down]
[count]gc<Down> is equivalent to [count]gcj, which comments [count]+1 lines by design, like other commands (dj deletes 2 lines).