branch: elpa/with-editor
commit 521f75e3f37c7fe204bddb8a29ce862cae8f59bd
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
with-editor-emulate-terminal: Extend search for editor instruction
The "WITH-EDITOR" instruction on stdout may follow other text on the
same line (even in cases where that is not the case for `shell-mode',
`eshell-mode' and `vterm'). Look for the instruction anywhere in the
output, not just at the beginning of lines.
---
with-editor.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/with-editor.el b/with-editor.el
index e079e81..c0bf1dd 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -757,7 +757,9 @@ This works in `shell-mode', `term-mode', `eshell-mode' and
(defun with-editor-emulate-terminal (process string)
"Like `term-emulate-terminal' but also handle edit requests."
- (with-editor-sleeping-editor-filter process string)
+ (let ((with-editor-sleeping-editor-regexp
+ (substring with-editor-sleeping-editor-regexp 1)))
+ (with-editor-sleeping-editor-filter process string))
(term-emulate-terminal process string))
(defvar with-editor-envvars '("EDITOR" "GIT_EDITOR" "HG_EDITOR"))