From 9d4d5b756a8598c4b5c842e9f1f33148af2af8fd Mon Sep 17 00:00:00 2001 From: Ethan Leba Date: Tue, 12 Apr 2022 10:31:58 -0700 Subject: [PATCH] fix(eval): lookup RET binding in insert if evil Otherwise, if the REPL was not in insert mode the send-to-buffer would fail. --- modules/tools/eval/autoload/repl.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/tools/eval/autoload/repl.el b/modules/tools/eval/autoload/repl.el index 9cb0e8227..93153fc74 100644 --- a/modules/tools/eval/autoload/repl.el +++ b/modules/tools/eval/autoload/repl.el @@ -136,7 +136,12 @@ immediately after." ;; current REPL uses comint. Even if it did, no telling if they ;; have their own `comint-send-input' wrapper, so to be safe, I ;; 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) (redisplay 'force))) (when (and (eq origin-window (selected-window))