branch: externals/coterm
commit 134202250ec0a2b0fe5a7eaf9d195e201d26d480
Author: Miha Rihtaršič <m...@kamnitnik.top>
Commit: Miha Rihtaršič <m...@kamnitnik.top>

    Move point before output insertion
    
    Insertion may fire up a minibuffer because of
    'comint-watch-for-password-prompt' and we don't want the point to be at a
    random position during the minibuffer.
---
 coterm.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/coterm.el b/coterm.el
index 64ebb1b..dbbd06c 100644
--- a/coterm.el
+++ b/coterm.el
@@ -837,8 +837,10 @@ NEWLINES is the number of newlines STR contains.  Unless 
it is
 zero, insertion must happen at the end of accessible portion of
 buffer and the scrolling region must cover the whole screen."
   (coterm--t-adjust-pmark proc-filt process)
-  (coterm--t-apply-proc-filt proc-filt process str)
-  (goto-char (process-mark process))
+  (let ((pmark (process-mark process)))
+    (goto-char pmark)
+    (coterm--t-apply-proc-filt proc-filt process str)
+    (goto-char pmark))
   (let ((column (current-column)))
     (if (zerop newlines)
         (if coterm--t-insert-mode

Reply via email to