mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-06 07:51:39 -05:00
Fix timing bug
This commit is contained in:
parent
658886780e
commit
c03493d82e
1 changed files with 5 additions and 3 deletions
|
@ -1103,19 +1103,21 @@ elements."
|
||||||
(cl-defmethod jupyter-handle-is-complete-reply ((client jupyter-repl-client) _req msg)
|
(cl-defmethod jupyter-handle-is-complete-reply ((client jupyter-repl-client) _req msg)
|
||||||
(jupyter-with-repl-buffer client
|
(jupyter-with-repl-buffer client
|
||||||
(jupyter-with-message-content msg (status indent)
|
(jupyter-with-message-content msg (status indent)
|
||||||
|
;; `run-at-time' is used here so that the waiting done in
|
||||||
|
;; `jupyter-repl-ret' completes before a cell is executed.
|
||||||
(pcase status
|
(pcase status
|
||||||
("complete"
|
("complete"
|
||||||
(jupyter-repl-execute-cell client))
|
(run-at-time 0 nil (lambda () (jupyter-repl-execute-cell client))))
|
||||||
("incomplete"
|
("incomplete"
|
||||||
(insert "\n")
|
(insert "\n")
|
||||||
(if (= (length indent) 0) (jupyter-repl-indent-line)
|
(if (= (length indent) 0) (jupyter-repl-indent-line)
|
||||||
(insert indent)))
|
(insert indent)))
|
||||||
("invalid"
|
("invalid"
|
||||||
;; Force an execute to produce a traceback
|
;; Force an execute to produce a traceback
|
||||||
(jupyter-repl-execute-cell client))
|
(run-at-time 0 nil (lambda () (jupyter-repl-execute-cell client))))
|
||||||
("unknown"
|
("unknown"
|
||||||
;; Let the kernel decide if the code is complete
|
;; Let the kernel decide if the code is complete
|
||||||
(jupyter-repl-execute-cell client))))))
|
(run-at-time 0 nil (lambda () (jupyter-repl-execute-cell client))))))))
|
||||||
|
|
||||||
(defun jupyter-repl--insert-banner-and-prompt (client)
|
(defun jupyter-repl--insert-banner-and-prompt (client)
|
||||||
(jupyter-with-repl-buffer client
|
(jupyter-with-repl-buffer client
|
||||||
|
|
Loading…
Add table
Reference in a new issue