zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
45.93k stars 2.55k forks source link

Extra quotes added when replacing with multi-cursor #14349

Open nicholasmarais1158 opened 1 month ago

nicholasmarais1158 commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

To replace the double quotes in this example with backticks;

  1. Start with a cursor after one of them and then add a second after the other
  2. Backspace the double quotes
  3. Add backticks

Notice that an extra backtick is added after the second. This is not the case in VSCode.

https://github.com/user-attachments/assets/4568aa3b-2907-4341-8d5d-a40a4cf5cfea

Environment

Zed: v0.143.7 (Zed) OS: macOS 14.5.0 Memory: 36 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

notpeter commented 1 month ago

Yeah, this seems like a bad interaction with multi-cursor and autosurround/autoclose.

image
benjaminwelch commented 6 days ago

This is happening with quotes (perhaps other characters as well) even with a single cursor:

zed-quote-insert-bug

It affects both single/double quotes for me if I type them out manually. It should autoclose the first one I type but it doesn't, then closes the second one.