Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim mode: delete subword deleting beyond the first punctuation #23344

Open
1 task done
sasanquaa opened this issue Jan 19, 2025 · 2 comments
Open
1 task done

Vim mode: delete subword deleting beyond the first punctuation #23344

sasanquaa opened this issue Jan 19, 2025 · 2 comments
Labels
bug [core label] vim

Comments

@sasanquaa
Copy link

sasanquaa commented Jan 19, 2025

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

  • Subword was implemented in vim: Add Subword Textobject #22387 (thanks!)

  • Use "w": "vim::NextSubwordStart" in keymap.json

  • Inside the below text with <char> indicating the cursor:

"ctrl-w h": ["workspace::ActivatePaneIn<D>irection", "Left"],
"ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"]
  • Use vim dw and text becomes:
"ctrl-w h": ["workspace::ActivatePaneIn<">,Left"],
"ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"]

Or when cursor at:

"ctrl-w h": ["workspace::ActivatePaneInDirection", "<L>eft"],
"ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"]
  • Use vim dw and text becomes (delete beyond " and two lines joined):
"ctrl-w h": ["workspace::ActivatePaneInDirection", "<">ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"]

In both cases, I expect the delete to stop at "

Zed Version and System Specs

Zed: v0.171.0 (Zed Dev b472bd9)
OS: Windows 10.0.19044
Memory: 31.8 GiB
Architecture: x86_64
GPU: NVIDIA GeForce RTX 3060 || NVIDIA || 546.17

If applicable, add screenshots or screencasts of the incorrect state / behavior

No response

If applicable, attach your Zed.log file to this issue.

No response

@sasanquaa sasanquaa added admin read bug [core label] labels Jan 19, 2025
@0x2CA
Copy link
Contributor

0x2CA commented Jan 20, 2025

The meaning of dw is to delete to the next word start, not to delete the word.

dw vim::NextSubwordStart

diw vim::Subword

This is a motions issue.

vim: subword motions #8725

@sasanquaa
Copy link
Author

Please correct me if I am wrong, but with the default word motion w: vim::NextWordStart, using dw would stop at " in the above example. So I am having the same expectation for dw with w: vim::NextSubwordStart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] vim
Projects
None yet
Development

No branches or pull requests

3 participants