zed icon indicating copy to clipboard operation
zed copied to clipboard

Surround on strings does not work with escaped quotes

Open jfontan opened this issue 1 year ago • 1 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

When using vim command di" on a double quoted string with escaped quotes it does not delete the whole string but only until the first escaped double quote. For example, in a JSON file with this string:

"test \"inside\""

If the cursor is over test and do di" it becomes:

""inside\""

I expect it to delete the whole string.

Also if I use cs"' with the cursor over test it becomes:

'test \'inside\""

I've tested the same with a Go file so it does not seem to be a problem with JSON files.

Environment

Zed: v1.0.0 (Zed Preview) OS: Linux 1.0.0 Memory: 31.3 GiB Architecture: x86_64

Version 0.132.0-1 installed in Manjaro with aur/zed-editor-preview package.

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

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

jfontan avatar Apr 21 '24 20:04 jfontan

I'll submit a PR to fix the issue

Kalmaegi avatar Apr 24 '24 03:04 Kalmaegi

I've just tested the change and seems to work as expected. Thank you!

jfontan avatar Apr 25 '24 09:04 jfontan

I've just tested the change and seems to work as expected. Thank you!

have a good day :D

Kalmaegi avatar Apr 25 '24 11:04 Kalmaegi