From 0cd8893eda31be2540ffc5833f16321b9b6bf723 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Sat, 25 May 2024 01:59:06 +0300 Subject: [PATCH] diff-mode: disable single-letter cmds w/o respect to selection in "visual" 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: https://github.com/emacs-evil/evil-collection/issues/810 --- modes/diff-mode/evil-collection-diff-mode.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modes/diff-mode/evil-collection-diff-mode.el b/modes/diff-mode/evil-collection-diff-mode.el index e9b0fb36..f624ec7a 100644 --- a/modes/diff-mode/evil-collection-diff-mode.el +++ b/modes/diff-mode/evil-collection-diff-mode.el @@ -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 @@ -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