Add emacs mode checks to insert mode checks

This is to accommodate users who default to emacs mode, rather than
insert mode. The two are also very alike, so many of these checks should
apply to both (almost) equally.
This commit is contained in:
Henrik Lissner 2020-12-11 17:36:12 -05:00
parent 8edabbecfa
commit d149c59d2e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 13 additions and 5 deletions

View file

@ -121,7 +121,8 @@ more information on modifiers."
(defun +evil--insert-newline-below-and-respect-comments-a (orig-fn count)
(if (or (not +evil-want-o/O-to-continue-comments)
(not (eq this-command 'evil-open-below))
(evil-insert-state-p))
(evil-insert-state-p)
(evil-emacs-state-p))
(funcall orig-fn count)
(letf! (defun evil-insert-newline-below () (+evil--insert-newline))
(let ((evil-auto-indent evil-auto-indent))
@ -131,7 +132,8 @@ more information on modifiers."
(defun +evil--insert-newline-above-and-respect-comments-a (orig-fn count)
(if (or (not +evil-want-o/O-to-continue-comments)
(not (eq this-command 'evil-open-above))
(evil-insert-state-p))
(evil-insert-state-p)
(evil-emacs-state-p))
(funcall orig-fn count)
(letf! (defun evil-insert-newline-above () (+evil--insert-newline 'above))
(let ((evil-auto-indent evil-auto-indent))