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

d in diff-mode + visual selection does not kill text #810

Open
Hi-Angel opened this issue Apr 18, 2024 · 1 comment · May be fixed by #815
Open

d in diff-mode + visual selection does not kill text #810

Hi-Angel opened this issue Apr 18, 2024 · 1 comment · May be fixed by #815

Comments

@Hi-Angel
Copy link

Hi-Angel commented Apr 18, 2024

Before trying to send a PR to fix that I decided to create this issue to discuss.

The problem case: I was editing a diff file. I have selected a large part of the diff that covers multiple files and pressed d to remove it. Then I saved and applied it. Now, can you imaging my surprise when I found that literally nothing has changed. The files I removed were still there, in git. Upon closer inspection turns out that evil-collection has bound this key to some mode-specific action diff-hunk-kill

I see 2 problems with that:

1.That seems to kind of beat the purpose of the plugin because from my understanding the plugin is trying to help with various annoying modes that override common Evil keybindings. But in this case it is the plugin that overrides it.
2. Even setting 1 aside, why d in visual mode? It is more confusing than it is helpful, because visual mode implies you've selected some region and so diff-hunk-kill should do the action over the region. Which diff-hunk-kill does not support.

Should the hotkey perhaps be removed?

@Hi-Angel
Copy link
Author

CC: @Ambrevar the commit author

Hi-Angel added a commit to Hi-Angel/evil-collection that referenced this issue May 24, 2024
Hi-Angel added a commit to Hi-Angel/evil-collection that referenced this issue Jun 15, 2024
…sual"

These commands do not respect selection done by `visual` mode, and
instead only work at (point). So running them in `visual` mode is
confusing. In `insert` mode they don't run anyway. So let's move them
to `normal` mode.

Fixes: emacs-evil#810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant