emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/coterm 5e40af4 47/80: Prevent modification of user inpu


From: ELPA Syncer
Subject: [elpa] externals/coterm 5e40af4 47/80: Prevent modification of user input harder
Date: Wed, 13 Oct 2021 18:57:34 -0400 (EDT)

branch: externals/coterm
commit 5e40af4df3c08bf37de9d57c24b4ceeb946b1c20
Author: m <>
Commit: m <>

    Prevent modification of user input harder
---
 coterm.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/coterm.el b/coterm.el
index 2c61ce7..b6c46cf 100644
--- a/coterm.el
+++ b/coterm.el
@@ -500,11 +500,15 @@ buffer and the scrolling region must cover the whole 
screen."
           (coterm--t-adjust-from-pmark pmark)
           (save-restriction
             (widen)
-            (unless (text-property-any
-                     pmark (point-max) 'field 'output)
-              ;; If pmark is at the end of buffer, not counting user input,
-              ;; prevent changing this user input by narrowing the buffer
-              (narrow-to-region (point-min) pmark))
+            (goto-char (point-max))
+            ;; Use narrowing to prevent modification of user input at end of
+            ;; buffer
+            (unless (eq (get-char-property (max 1 (1- (point-max))) 'field)
+                        'output)
+              (goto-char (point-max))
+              (text-property-search-backward 'field 'output)
+              (when (<= pmark (point))
+                (narrow-to-region (point-min) (point))))
 
             (while (setq match (string-match coterm--t-control-seq-regexp
                                              string ctl-end))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]