zed icon indicating copy to clipboard operation
zed copied to clipboard

Extra quotes added when replacing with multi-cursor

Open nicholasmarais1158 opened this issue 1 year ago • 2 comments

Check for existing issues

  • [X] Completed

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

nicholasmarais1158 avatar Jul 12 '24 16:07 nicholasmarais1158

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

Image

notpeter avatar Jul 16 '24 16:07 notpeter

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.

benjaminwelch avatar Aug 23 '24 16:08 benjaminwelch

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!

github-actions[bot] avatar Mar 11 '25 11:03 github-actions[bot]

@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.

notpeter avatar Mar 11 '25 17:03 notpeter