>From 04c5cd7cf5539fddd3ca04c9730b1629e323211d Mon Sep 17 00:00:00 2001 From: John Shahid Date: Sun, 28 Apr 2019 15:59:50 -0400 Subject: [PATCH] Prevent accidental edits in the ansi-term buffer from breaking resizing * 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/term.el b/lisp/term.el index 8a28e6df28..f051e63415 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -2935,7 +2935,8 @@ term-emulate-terminal (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 @@ term-unwrap-line (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 -- 2.21.0