diff: Only switch mode with read-only when in diff-mode

This commit is contained in:
Pierre Neidhardt 2018-06-28 14:41:12 +02:00
parent 6bfd13f50f
commit 6a30d6b2ad
1 changed files with 4 additions and 4 deletions

View File

@ -42,10 +42,10 @@
(defun evil-collection-diff-read-only-state-switch ()
"Make read-only in motion state, writable in normal state."
(if buffer-read-only
(progn
(evil-motion-state))
(evil-normal-state)))
(when (eq major-mode 'diff-mode)
(if buffer-read-only
(evil-motion-state)
(evil-normal-state))))
(defun evil-collection-diff-toggle-setup ()
"Toggle visiting diff buffers in motion state."