emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil-escape 80029c6892 108/133: Add support for evil-magit


From: ELPA Syncer
Subject: [nongnu] elpa/evil-escape 80029c6892 108/133: Add support for evil-magit
Date: Wed, 3 Jan 2024 21:59:57 -0500 (EST)

branch: elpa/evil-escape
commit 80029c689217fe43834e13e432ce243b02359aa3
Author: syl20bnr <sylvain.benner@gmail.com>
Commit: syl20bnr <sylvain.benner@gmail.com>

    Add support for evil-magit
    
    Fixes #62
---
 evil-escape.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/evil-escape.el b/evil-escape.el
index 16d012ff0c..fe26a85a80 100644
--- a/evil-escape.el
+++ b/evil-escape.el
@@ -202,6 +202,7 @@ with a key sequence."
        (or (window-minibuffer-p)
            (bound-and-true-p isearch-mode)
            (eq 'ibuffer-mode major-mode)
+           (evil-escape--is-magit-buffer)
            (and (fboundp 'helm-alive-p) (helm-alive-p))
            (or (not (eq 'normal evil-state))
                (not (eq 'evil-force-normal-state
@@ -222,6 +223,7 @@ with a key sequence."
   (cond
    ((and (fboundp 'helm-alive-p) (helm-alive-p)) 'helm-keyboard-quit)
    ((eq 'ibuffer-mode major-mode) 'ibuffer-quit)
+   ((evil-escape--is-magit-buffer) 'evil-escape--escape-with-q)
    ((bound-and-true-p isearch-mode) 'isearch-abort)
    ((window-minibuffer-p) 'abort-recursive-edit)
    (t (lookup-key evil-normal-state-map [escape]))))
@@ -245,7 +247,7 @@ with a key sequence."
   (cond
    ((bound-and-true-p isearch-mode) 'isearch-abort)
    ((window-minibuffer-p) 'abort-recursive-edit)
-   ((string-match "magit" (symbol-name major-mode)) 
'evil-escape--escape-with-q)
+   ((evil-escape--is-magit-buffer) 'evil-escape--escape-with-q)
    ((eq 'ibuffer-mode major-mode) 'ibuffer-quit)
    ((eq 'emoji-cheat-sheet-plus-buffer-mode major-mode) 'kill-this-buffer)
    ((eq 'paradox-menu-mode major-mode) 'evil-escape--escape-with-q)
@@ -315,6 +317,10 @@ with a key sequence."
   (interactive)
   (setq unread-command-events (listify-key-sequence "q")))
 
+(defun evil-escape--is-magit-buffer ()
+  "Return non nil if the current buffer is a Magit buffer."
+  (string-match "magit" (symbol-name major-mode)))
+
 (provide 'evil-escape)
 
 ;;; evil-escape.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]