Skip to content

Commit

Permalink
diff-mode: disable single-letter cmds w/o respect to selection in "vi…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Hi-Angel committed Jun 15, 2024
1 parent b34369c commit 0cd8893
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modes/diff-mode/evil-collection-diff-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ current file instead."

"q" 'quit-window

"a" 'diff-apply-hunk
"*" 'diff-refine-hunk
"D" 'diff-file-kill
"d" 'diff-hunk-kill
"s" 'diff-split-hunk
"c" 'diff-test-hunk

"\\" 'read-only-mode) ; magit has "\"

(evil-collection-define-key 'motion 'diff-mode-map
Expand All @@ -119,17 +126,10 @@ current file instead."
(kbd "RET") 'diff-goto-source
"A" 'diff-add-change-log-entries-other-window

"a" 'diff-apply-hunk
"*" 'diff-refine-hunk
"D" 'diff-file-kill
"d" 'diff-hunk-kill

"ge" 'diff-ediff-patch
"i" 'next-error-follow-minor-mode
"o" 'evil-collection-diff-toggle-restrict-view
"~" 'diff-reverse-direction
"s" 'diff-split-hunk
"c" 'diff-test-hunk
"x" 'evil-collection-diff-toggle-context-unified
"#" 'diff-ignore-whitespace-hunk

Expand Down

0 comments on commit 0cd8893

Please sign in to comment.