forked from mirrors/org-mode
org-babel-comint-with-output: Fix another edge case with REPL prompts
* lisp/ob-comint.el (org-babel-comint-with-output): Sometimes, REPL can split whitespace between sequence of prompt prompt prompt. In particular, inf-ruby did this on multiline input.
This commit is contained in:
parent
8000b11209
commit
ff53846f31
|
@ -111,12 +111,13 @@ or user `keyboard-quit' during execution of body."
|
|||
;; Sometimes, we get multiple agglomerated
|
||||
;; prompts together in a single output:
|
||||
;; "prompt prompt prompt output"
|
||||
;; Or even "<whitespace>prompt<whitespace>prompt ...>.
|
||||
;; Remove them progressively, so that
|
||||
;; possible "^" in the prompt regexp gets to
|
||||
;; work as we remove the heading prompt
|
||||
;; instance.
|
||||
(if (string-prefix-p "^" comint-prompt-regexp)
|
||||
(format "^\\(%s\\)+" (substring comint-prompt-regexp 1))
|
||||
(format "^\\([ \t]*%s\\)+" (substring comint-prompt-regexp 1))
|
||||
comint-prompt-regexp)
|
||||
,org-babel-comint-prompt-separator
|
||||
string-buffer))
|
||||
|
|
Loading…
Reference in New Issue