[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 9ac7645: Fix column double counting in term.el (Bug
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] master 9ac7645: Fix column double counting in term.el (Bug#31662) |
Date: |
Fri, 1 Jun 2018 23:07:34 -0400 (EDT) |
branch: master
commit 9ac76456eb104f749aa9c60b99c68a649214efc6
Author: John Shahid <address@hidden>
Commit: Noam Postavsky <address@hidden>
Fix column double counting in term.el (Bug#31662)
* lisp/term.el (term-emulate-terminal): Invalidate
`term-current-column' after deleting overwritten text.
---
lisp/term.el | 3 ++-
test/lisp/term-tests.el | 7 +++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/lisp/term.el b/lisp/term.el
index 19e68dd..715f39b 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -2904,7 +2904,8 @@ See `term-prompt-regexp'."
(when (not (or (eobp) term-insert-mode))
(let ((pos (point)))
(term-move-columns columns)
- (delete-region pos (point))))
+ (delete-region pos (point))
+ (setq term-current-column nil)))
;; In insert mode if the current line
;; has become too long it needs to be
;; chopped off.
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
index 8aaa61a..72a9ad1 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -89,6 +89,13 @@ first line\r_next line\r\n"))
"\e[2;1Hc"
"\e[1;2Hb"
"\e[1;1Ha") "" t))))
+ (should (equal "abcde j"
+ (term-test-screen-from-input
+ 10 12 '("abcdefghij"
+ "\e[H" ;move back to point-min
+ "abcde"
+ " j"))))
+
;; Relative positioning.
(should (equal "ab\ncd"
(term-test-screen-from-input
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 9ac7645: Fix column double counting in term.el (Bug#31662),
Noam Postavsky <=