emacs-evil / evil-collection

A set of keybindings for evil-mode

Repository from Github https://github.comemacs-evil/evil-collectionRepository from Github https://github.comemacs-evil/evil-collection

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

Hi-Angel opened this issue · comments

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?

CC: @Ambrevar the commit author

Feel free to submit a PR to discuss better keybindings. What you're suggesting doesn't seem like a bad idea at an initial glance.

@jojojames I am confused. There was a PR that is closing this issue that has undergone multiple changes and was stuck on discussion. You closed it because it's currently not ready to merge, okay. But then, the only thing I can do here is to open a PR that simply removes the d keybinding from the code, because the better way which is "only remove it for visual state but leave it for normal" just doesn't work for whatever reason. So what do I need to do here?

So what do I need to do here?

You can reopen the issue in the PR. I closed this issue because the topic of this issue is no longer relevant (e.g. can be handled in the PR)

The PR being closed can be reopened as long as there's further interest.

(I also added a change here 22e45c6 that might fix (or worsen) some things for you.)

Hope you can try it out and we can go from there.

(I also added a change here 22e45c6 that might fix (or worsen) some things for you.)

Thank you, in my testing it does seem to fix!

got it thx