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

diff-mode: disable single-letter cmds w/o respect to selection in "visual" #815

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hi-Angel
Copy link

@Hi-Angel Hi-Angel commented May 24, 2024

As mentioned in the original issue, the keybinding is confusing and problematic. There has been no opposing comments for 1.5 months, so let's go ahead and remove make it to only work in normal.

Fixes: #810

@condy0919
Copy link
Collaborator

@jojojames What's your thoughts?

@jojojames
Copy link
Collaborator

Wouldn't you want to move the key somewhere else than to remove it entirely?

@Hi-Angel
Copy link
Author

Hi-Angel commented Jun 3, 2024

Sorry, I didn't know what modes motion includes. Is it just normal and visual? If that's the case, then indeed your idea is a good one, moreover, I think it's better to move every single-letter command that does not respect selection to under the "normal".

@Hi-Angel
Copy link
Author

Hi-Angel commented Jun 3, 2024

It's just that I don't know, the motion state does not seem to be documented. There's this answer which implies it is completely unrelated to "normal" and "visual" and instead it is for read-only buffers like *Help*. But that doesn't make sense to me because from the bug we can clearly see that it influences visual state in an editable buffer/major-mode.

@jojojames
Copy link
Collaborator

motion -> normal is fine.

…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
@Hi-Angel Hi-Angel changed the title diff-mode: remove confusing visual-mode keybinding diff-hunk-kill diff-mode: disable single-letter cmds w/o respect to selection in "visual" Jun 15, 2024
@Hi-Angel
Copy link
Author

@jojojames done, please see if it looks okay now

@Hi-Angel
Copy link
Author

Actually, wait, I see another command that may be confusing when used in "visual"

@Hi-Angel
Copy link
Author

@jojojames okay, so, I'm afraid your idea with moving stuff under the "normal" is not working due to a bug somewhere. When I'm testing the current changes, while pressing d in "visual" I still see the hunk getting deleted even though it is no longer under "motion".

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 this pull request may close these issues.

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