Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions elpy-shell.el
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,10 @@ complete). Otherwise, does nothing."
(let ((from-point (point)))
(insert string)
(if (not no-font-lock)
(add-text-properties from-point (point)
(list 'front-sticky t 'font-lock-face face)))))
(if (eq face 'python-font-lock)
(python-shell-font-lock-post-command-hook)
(add-text-properties from-point (point)
(list 'front-sticky t 'font-lock-face face))))))

(defun elpy-shell--append-to-shell-output (string &optional no-font-lock prepend-cont-prompt)
"Append the given STRING to the output of the Python shell buffer.
Expand All @@ -540,19 +542,19 @@ Prepends a continuation promt if PREPEND-CONT-PROMPT is set."
(lines (split-string string "\n")))
(goto-char mark-point)
(elpy-shell--insert-and-font-lock
(car lines) 'comint-highlight-input no-font-lock)
(car lines) 'python-font-lock no-font-lock)
(when (cdr lines)
;; no additional newline at end for multiline
(dolist (line (cdr lines))
(insert "\n")
(elpy-shell--insert-and-font-lock
prompt 'comint-highlight-prompt no-font-lock)
(elpy-shell--insert-and-font-lock
line 'comint-highlight-input no-font-lock)))
line 'python-font-lock no-font-lock)))
;; but put one for single line
(insert "\n"))
(elpy-shell--insert-and-font-lock
string 'comint-highlight-input no-font-lock))
string 'python-font-lock no-font-lock))
(set-marker (process-mark process) (point)))))))

(defun elpy-shell--string-head-lines (string n)
Expand Down