fix(eval): lookup RET binding in insert if evil

Otherwise, if the REPL was not in insert mode the send-to-buffer would
fail.
This commit is contained in:
Ethan Leba 2022-04-12 10:31:58 -07:00 committed by Henrik Lissner
parent 3a34894492
commit 9d4d5b756a

View file

@ -136,7 +136,12 @@ immediately after."
;; current REPL uses comint. Even if it did, no telling if they ;; current REPL uses comint. Even if it did, no telling if they
;; have their own `comint-send-input' wrapper, so to be safe, I ;; have their own `comint-send-input' wrapper, so to be safe, I
;; simply emulate the keypress. ;; simply emulate the keypress.
(call-interactively (doom-lookup-key (kbd "RET")))) (call-interactively
(if (bound-and-true-p evil-local-mode)
(evil-save-state
(evil-insert-state)
(doom-lookup-key (kbd "RET")))
(doom-lookup-key (kbd "RET")))))
(sit-for 0.001) (sit-for 0.001)
(redisplay 'force))) (redisplay 'force)))
(when (and (eq origin-window (selected-window)) (when (and (eq origin-window (selected-window))