Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e64bfee

Browse files
committed
(py-process-filter): if command takes a long time, input typed before
the next prompt could end up in the middle of the line, instead of after it. Fix given by [email protected].
1 parent 6e98f33 commit e64bfee

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

Misc/python-mode.el

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ See the `\\[py-shell]' docs for additional warnings."
654654
(set-buffer pbuf)
655655
(let* ((start (point))
656656
(goback (< start pmark))
657+
(goend (and (not goback) (= start (point-max))))
657658
(buffer-read-only nil))
658659
(goto-char pmark)
659660
(insert string)
@@ -670,14 +671,18 @@ See the `\\[py-shell]' docs for additional warnings."
670671
(if py-scroll-process-buffer
671672
(let* ((pop-up-windows t)
672673
(pwin (display-buffer pbuf)))
673-
(set-window-point pwin (point))))))
674-
(set-buffer curbuf)
675-
(if file-finished
676-
(progn
677-
(py-delete-file-silently (car py-file-queue))
678-
(setq py-file-queue (cdr py-file-queue))
679-
(if py-file-queue
680-
(py-execute-file pyproc (car py-file-queue)))))))
674+
(set-window-point pwin (point)))))
675+
(set-buffer curbuf)
676+
(if file-finished
677+
(progn
678+
(py-delete-file-silently (car py-file-queue))
679+
(setq py-file-queue (cdr py-file-queue))
680+
(if py-file-queue
681+
(py-execute-file pyproc (car py-file-queue)))))
682+
(and goend
683+
(progn (set-buffer pbuf)
684+
(goto-char (point-max))))
685+
)))
681686

682687
(defun py-execute-buffer ()
683688
"Send the contents of the buffer to a Python interpreter.

0 commit comments

Comments
 (0)