]> git.eshelyaron.com Git - emacs.git/commitdiff
Prevent accidental edits in the ansi-term buffer from breaking resizing
authorJohn Shahid <jvshahid@gmail.com>
Sun, 28 Apr 2019 19:59:50 +0000 (15:59 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 6 May 2019 18:35:40 +0000 (14:35 -0400)
* lisp/term.el (term-unwrap-line, term-emulate-terminal): Prevent the
  `term-line-wrap` property of newlines from spreading accidentally
  when inserting text next to it.

lisp/term.el

index 586a887a29f52922fb913efa0b9b9b3c57b7817e..283e5684b72d12e03a739fd79841073ffff5f945 100644 (file)
@@ -2935,7 +2935,8 @@ See `term-prompt-regexp'."
                       (delete-region (point) (line-end-position))
                       (term-down 1 t)
                       (term-move-columns (- (term-current-column)))
-                      (put-text-property (1- (point)) (point) 'term-line-wrap t)
+                      (add-text-properties (1- (point)) (point)
+                                           '(term-line-wrap t rear-nonsticky t))
                       (setq decoded-substring
                             (substring decoded-substring (- term-width old-column)))
                       (setq old-column 0)))
@@ -3754,7 +3755,8 @@ all pending output has been dealt with."))
   (when (not (bolp))
     (let ((old-point (point)))
       (insert-before-markers ?\n)
-      (put-text-property old-point (point) 'term-line-wrap t))))
+      (add-text-properties old-point (point)
+                           '(term-line-wrap t rear-nonsticky t)))))
 
 (defun term-erase-in-line (kind)
   (when (= kind 1) ;; erase left of point