question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Commenting multiple line in visual mode inserts extra slashes

See original GitHub issue

First of all, excellent project!

The visual mode adds multi cursors automatically, when I select multiple lines and commenting with cmd+/, two sets slashes will be inserted and cannot uncomment once.

I hardly use multi-cursors before, so I’m not sure adding multi-cursor as a default behavior is suitable for most users.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
codeincontextcommented, Dec 17, 2019

@asvetliakov great, that’s really helpful. Thank you for taking the time to investigate ⚡️

1reaction
asvetliakovcommented, Dec 15, 2019

Unfortunately this is not fixable due to cursor pos differences. In vscode cursor pos is actual before the character, in vim it’s on character. This is not problem for right-2-left visual selections but for left-2-right one character is not being selected due to this. I’m workarounding this problem by creating second selection for 1 right character, that’s why commenting through vscode command produces multiple comments (because there are 2 cursors on line for left-2-right visual selection).

The solution is not to use builtin vscode comment key and use xmap gc <Plug>VSCodeCommentary bound to some key.

As workaround i’ll remap <C-/> to call VSCodeCommentary

Read more comments on GitHub >

github_iconTop Results From Across the Web

Commenting multiple line in visual mode inserts extra slashes
I'm workarounding this problem by creating second selection for 1 right character, that's why commenting through vscode command produces ...
Read more >
How to get Visual Studio quick comments to add a space after ...
Apparently, StyleCop doesn't care if there's a space after four slashes, only after two. It seems some people really like this rule behavior....
Read more >
Comment Out Multiple Lines At Once In Vim Editor - OSTechNix
Method 4: ; Step 2: Go to the line you want to comment. Press ; Ctrl+V to enter into 'Visual block' mode.
Read more >
3 Ways to Comment Out Blocks of Code in vi
Hit SHIFT + i (capital i) to enter insert mode. Uncommenting is just as simple. Hit CTRL + v to enter visual block...
Read more >
disable new extend multiline comments in c++ feature
After I type a first line of /* or /// comment, when I press ENTER, Visual inserts more comments on the following line....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found