zed
zed copied to clipboard
Extra quotes added when replacing with multi-cursor
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
To replace the double quotes in this example with backticks;
- Start with a cursor after one of them and then add a second after the other
- Backspace the double quotes
- 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
Yeah, this seems like a bad interaction with multi-cursor and autoclose.
This is happening with quotes (perhaps other characters as well) even with a single cursor:
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.
Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 7 days. Thanks for your help!
@benjaminwelch I am no longer able to reproduce the issue you are seeing with default settings and the Ruby extension installed and so I am inclined to believe it has been fixed.
@nicholasmarais1158 I can still reproduce your original issue. A workaround is to set "use_autoclose": false. Hilariously, the legit use case of use_autoclose with multiple cursors (e.g. create multiple cursors at the beginning of successive lines and start typing strings with " or ') doesn't actually trigger autoclose and you have to type the closing characters anyways. I think I'm just going to disable use_autoclose with multiple selections.
Edit: It's more complicated than I thought.