From aa3c18a849036df58b6cdb6ba4efbc043f63d4a7 Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Fri, 7 Mar 2025 11:10:09 -0800 Subject: [PATCH] Stop moving markers during erase-in-line We shouldn't move a line marker just because we cleared a line next to it. clear-in-line is defined not to affect line structure. * lisp/term.el (term-erase-in-line): use insert-before-markers (cherry picked from commit 6f19715937bbeaec5fb80ee9dad0d14b7712a989) --- lisp/term.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/term.el b/lisp/term.el index 0048e0c6908..c03a5c26c89 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -4031,7 +4031,10 @@ The top-most line is line 0." ;; extra space when wrapped is false. (when wrapped (insert ? )) - (insert ?\n) + ;; If there's a marker at the start of the next line, we shouldn't + ;; disturb it: erase-in-line doesn't change logical + ;; line structure. + (insert-before-markers ?\n) (put-text-property saved-point (point) 'font-lock-face 'default) (goto-char saved-point)))) -- 2.39.5