branch: elpa/idris-mode
commit 4305a9d7ad069f5c75305cef350110187c551a7d
Author: Marek L <[email protected]>
Commit: Marek L <[email protected]>

    Ensure Idris is running and current Idris is file loaded when using 
`idris-switch-to-repl`
    
    Why:
    Allows to jump to the repl without having to manually start repl
    using a shortcut
---
 idris-repl.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/idris-repl.el b/idris-repl.el
index add8346f19..a60e442aa7 100644
--- a/idris-repl.el
+++ b/idris-repl.el
@@ -186,9 +186,12 @@ If ALWAYS-INSERT is non-nil, always insert a prompt at the 
end of the buffer."
       (idris-repl-insert-prompt)
       (insert current-input))))
 
+(autoload 'idris-load-file-sync "idris-commands.el")
+;;;###autoload
 (defun idris-switch-to-repl ()
-  "Select the output buffer and scroll to bottom."
-  (interactive)
+  "Load the current Idris file buffer and jump to the Idris REPL."
+  (interactive nil idris-mode)
+  (idris-load-file-sync)
   (pop-to-buffer (idris-repl-buffer))
   (goto-char (point-max)))
 
@@ -199,7 +202,8 @@ If ALWAYS-INSERT is non-nil, always insert a prompt at the 
end of the buffer."
 (defun idris-repl ()
   (interactive)
   (idris-run)
-  (idris-switch-to-repl))
+  (pop-to-buffer (idris-repl-buffer))
+  (goto-char (point-max)))
 
 (defvar idris-repl-mode-map
   (let ((map (make-sparse-keymap)))

Reply via email to