Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annoying brackets autoremoving #3936

Closed
kerrytazi opened this issue Aug 1, 2019 · 1 comment · Fixed by #3941
Closed

Annoying brackets autoremoving #3936

kerrytazi opened this issue Aug 1, 2019 · 1 comment · Fixed by #3941
Labels

Comments

@kerrytazi
Copy link

Description
Removing left bracket using Backspace cause autoremoving of right bracket.

Steps to reproduce the behavior
| is cursor position

text(|)text
<Backspace>
text|text

Expected behavior

text|)text

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.9.0
  • VSCode version: 1.36.1
  • OS: Windows 10 x64 10.0.17763

Additional context
VSCode by itself have option "editor.autoClosingBrackets": "never" and it works well without VsCodeVim.

Similar problem? #1231
There are no comments how to fix it. Pressing Ctrl works but is not solution.

@J-Fields
Copy link
Member

J-Fields commented Aug 3, 2019

Reproduced and working on a fix - will probably deliver a PR some time this weekend. I believe this is a regression due to VSCode changing editor.autoClosingBrackets to an enum from a bool. We can handle always, never, and beforeWhitespace correctly, but I don't think we can get language-specific configuration (at least in general), so we might not be able to deliver a perfect solution. There's also editor.autoClosingQuotes which should be handled separately.
I also feel like X in normal mode should be treated the same way, but I don't think I'll tackle that issue now.

J-Fields added a commit that referenced this issue Aug 28, 2019
…hen deleting a bracket/quote (#3941)

When we delete a "pairable" character like (, we look to the right to see if there's the matching ) and delete it is well. We should not do that if auto-matching is disabled in settings. This behavior regressed because the type of editor.autoClosingBrackets was changed from a bool to a more fine-grained enum. There's also editor.autoClosingQuotes now, so we should respect that too.
Fixes #3936
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants