zed
zed copied to clipboard
Extra quote JS/TS
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
When I put a closing slash quote in JS/TS (+JSX/TSX) file, I get an extra one
Environment
Zed: v0.129.2 (Zed) OS: macOS 14.4.1 Memory: 8 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
https://github.com/zed-industries/zed/assets/91194878/a9eea207-ec76-47cb-bf5f-f46e5586cba4
If applicable, attach your ~/Library/Logs/Zed/Zed.log
file to this issue.
No response
Thanks for the report @nothugofsea. I'm not able to reproduce it on my end in a .js
file - @maxbrunsfeld, is this the same thing that was fixed before here?
- https://github.com/zed-industries/zed/issues/5801
Is this a regression or a different bug?
Oh, interesting enough, I can't reproduce it when I test it in the middle of a file, but when I test it at the end of a file, I get the same before as @nothugofsea - his video shows the bug occurring at the end of their file as well.
In addition, I want to say that this problem also applies to regular quotes.
Zed: v0.130.6 (Zed) OS: macOS 14.4.1 Memory: 8 GiB Architecture: aarch64
https://github.com/zed-industries/zed/assets/91194878/c8f81e6e-4fad-4686-ad42-d81244e4412c
Also happens in comments in C++, very annoying
@JosephTLyons going to tack onto this one instead of a new issue:
When we're within a code comment, Zed will insert closing/extra quotes. If I start typing a comment like // Note:
and I add can't
to that line, as soon as I type the single quote character, Zed automatically adds a closing quote character to the end of the line. Subsequent key presses insert chars before the closing quote, but it's still there and it's erroneous. Similarly, backticks within comments have the same behavior.
In addition, I want to say that this problem also applies to regular quotes.
Zed: v0.130.6 (Zed) OS: macOS 14.4.1 Memory: 8 GiB Architecture: aarch64
Screen.Recording.2024-04-12.at.5.30.57.AM.mov
Running into the same issue. The issue affects both single and double quotes.
If I select something, and then use quotes, it wraps the selection correctly, so it only seems to be an issue when typing them out manually.
The expected behavior:
- when I type the first quote, the second one is inserted and the cursor is between them.
- if a closing quote already exists
'new_transaction'
and I insert one at the end of the string, it should simply move the cursor over and not insert a new one.
Pretty sure this has been happening since I started using Zed. I'm on Mac OS, most recent Zed installed. Happy to provide more info if needed.
The extra quote is inconvenient
https://github.com/user-attachments/assets/e0a7025f-7bf1-4e44-a235-f3ffd90c29a7