mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
Fix how ein:cell-max-num-outputs is treated
Previous version added newline after "." every time when the new output is sent from the server.
This commit is contained in:
parent
1a6f4cfa58
commit
d65394ff75
1 changed files with 9 additions and 6 deletions
|
@ -461,9 +461,7 @@ Called from ewoc pretty printer via `ein:cell-pp'."
|
|||
(= (1+ index) ein:cell-max-num-outputs))
|
||||
;; The first output which exceeds `ein:cell-max-num-outputs'.
|
||||
(ein:insert-read-only "\n"))
|
||||
(ein:insert-read-only ".")
|
||||
(when (= (1+ index) (ein:cell-num-outputs cell))
|
||||
(ein:insert-read-only "\n")))
|
||||
(ein:insert-read-only "."))
|
||||
(let ((out (nth index (oref cell :outputs))))
|
||||
;; Handle newline for previous stream output.
|
||||
;; In IPython JS, it is handled in `append_stream' because JS
|
||||
|
@ -494,9 +492,14 @@ Called from ewoc pretty printer via `ein:cell-pp'."
|
|||
(ein:insert-read-only "\n"))
|
||||
|
||||
(defmethod ein:cell-insert-footer ((cell ein:codecell))
|
||||
(let ((last-out (car (last (oref cell :outputs)))))
|
||||
(when (equal (plist-get last-out :output_type) "stream")
|
||||
(ein:cell-append-stream-text-fontified "\n" last-out)))
|
||||
(if (or (oref cell :collapsed)
|
||||
(and ein:cell-max-num-outputs
|
||||
(> (ein:cell-num-outputs cell) ein:cell-max-num-outputs)))
|
||||
;; Add a newline after the last ".".
|
||||
(ein:insert-read-only "\n")
|
||||
(let ((last-out (car (last (oref cell :outputs)))))
|
||||
(when (equal (plist-get last-out :output_type) "stream")
|
||||
(ein:cell-append-stream-text-fontified "\n" last-out))))
|
||||
(call-next-method))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue