emacs/dired: disable dired-git-info-mode in wdired-mode

And refactor ranger/dired keybind for dired-git-info-mode (#2106).
This commit is contained in:
Henrik Lissner 2019-11-23 01:26:17 -05:00
parent 44e22b7f80
commit 5608ba7236
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -182,8 +182,20 @@ we have to clean it up ourselves."
:init :init
(add-hook 'dired-after-readin-hook '+dired-enable-git-info-h) (add-hook 'dired-after-readin-hook '+dired-enable-git-info-h)
:config :config
(if (featurep! +ranger) (map! :map (dired-mode-map ranger-mode-map)
(map! :map ranger-mode-map :ng ")" #'dired-git-info-mode)
:ng ")" #'dired-git-info-mode) (after! wdired
(map! :map dired-mode-map ;; Temporarily disable `dired-git-info-mode' when entering wdired, due to
:ng ")" #'dired-git-info-mode))) ;; reported incompatibilities.
(defvar +dired--git-info-p nil)
(defadvice! +dired--disable-git-info-a (&rest _)
:before #'wdired-change-to-wdired-mode
(setq +dired--git-info-p dired-git-info-mode)
(when +dired--git-info-p
(dired-git-info-mode -1)))
(defadvice! +dired--reactivate-git-info-a (&rest _)
:after '(wdired-exit
wdired-abort-changes
wdired-finish-edit)
(when +dired--git-info-p
(dired-git-info-mode +1)))))