Fix incorrect newline placement on send-to-REPL
Sending this form to a REPL (like ielm): (defun test (n) ...) Will yield: (defun test (n ...)) Because our RET emulation doesn't take evil's off-by-one cursor placement into account.
This commit is contained in:
parent
699e18b7f1
commit
c9eb00a217
1 changed files with 5 additions and 3 deletions
|
@ -132,9 +132,11 @@ immediately after."
|
|||
(insert line)
|
||||
(if inhibit-auto-execute-p
|
||||
(insert "\n")
|
||||
;; `comint-send-input' isn't enough because some REPLs may not use
|
||||
;; comint, so just emulate the keypress.
|
||||
(execute-kbd-macro (kbd "RET")))
|
||||
;; Can't use `comint-send-input' b/c there's no guarantee the
|
||||
;; 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"))))
|
||||
(sit-for 0.001)
|
||||
(redisplay 'force)))
|
||||
(when (and (eq origin-window (selected-window))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue