zed icon indicating copy to clipboard operation
zed copied to clipboard

Extra quote JS/TS

Open notcodev opened this issue 10 months ago • 6 comments

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

notcodev avatar Apr 06 '24 03:04 notcodev

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?

JosephTLyons avatar Apr 08 '24 03:04 JosephTLyons

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.

JosephTLyons avatar Apr 08 '24 03:04 JosephTLyons

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

notcodev avatar Apr 12 '24 02:04 notcodev

Also happens in comments in C++, very annoying

ske2004 avatar Jun 10 '24 11:06 ske2004

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

shellscape avatar Jun 11 '24 15:06 shellscape

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.

zed-quote-insert-bug

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.

benjaminwelch avatar Aug 23 '24 16:08 benjaminwelch

The extra quote is inconvenient

https://github.com/user-attachments/assets/e0a7025f-7bf1-4e44-a235-f3ffd90c29a7

trivikr avatar Aug 24 '24 04:08 trivikr