Skip to content

Commit

Permalink
Ensure continuation prompt is displayed properly
Browse files Browse the repository at this point in the history
  • Loading branch information
galaunay committed Dec 29, 2019
1 parent c7c252d commit a698cfd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions elpy-shell.el
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,13 @@ Prepends a continuation promt if PREPEND-CONT-PROMPT is set."
(save-excursion
(goto-char mark-point)
(if prepend-cont-prompt
(let* ((column (+ (- (point) (progn (forward-line -1) (end-of-line) (point))) 1))
(prompt (concat (make-string (max 0 (- column 7)) ? ) "...: "))
(let* ((column (+ (- (point)
(let ((inhibit-field-text-motion t))
(forward-line -1)
(end-of-line)
(point)))
1))
(prompt (concat (make-string (max 0 (- column 6)) ? ) "... "))
(lines (split-string string "\n")))
(goto-char mark-point)
(elpy-shell--insert-and-font-lock
Expand Down
4 changes: 2 additions & 2 deletions test/elpy-shell-echo-inputs-and-outputs-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
(with-current-buffer "*Python*"
(elpy/wait-for-output "OK" 30)
(buffer-string))))
(should (string-match "...: a = 2\\+2"
(should (string-match "... a = 2\\+2"
(with-current-buffer "*Python*"
(buffer-string))))
;; on "a = 2+2"
Expand All @@ -68,7 +68,7 @@
(with-current-buffer "*Python*"
(elpy/wait-for-output "OK" 30)
(buffer-string))))
(should (string-match "...: 4\\+3"
(should (string-match "... 4\\+3"
(with-current-buffer "*Python*"
(buffer-string))))
;; on a portion of line "d=14"
Expand Down

0 comments on commit a698cfd

Please sign in to comment.