GNU bug report logs -
#31662
[PATCH] fix double counting bug in term.el
Previous Next
Reported by: John Shahid <jvshahid <at> gmail.com>
Date: Thu, 31 May 2018 04:51:01 UTC
Severity: normal
Tags: fixed, patch
Found in version 27.0.50
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Noam Postavsky <npostavs <at> gmail.com> writes:
> John Shahid <jvshahid <at> gmail.com> writes:
>
>> Thanks for the feedback. I fixed both issues in the attached patch.
>
> Thanks, looks good.
>
>> Subject: [PATCH] * lisp/term.el (term-emulate-terminal): fix column double
>> counting
>
> Minor nitpick ChangeLog formatting nitpick, the sentence should be
> capitalized and end with a period.
fixed in the attached patch
>
> Have you assigned copyright for Emacs? (the patch is small enough to go
> in regardless, but it would need to be marked as a tiny change)
Yes I did. Should I attach the signed assignment to the bug report ?
cheers,
-js
[0001-lisp-term.el-term-emulate-terminal-Fix-column-double.patch (text/x-diff, inline)]
From 26219852992155889e142fb2b45f559ec6318c28 Mon Sep 17 00:00:00 2001
From: John Shahid <jvshahid <at> gmail.com>
Date: Wed, 30 May 2018 23:55:16 -0400
Subject: [PATCH] * lisp/term.el (term-emulate-terminal): Fix column double
counting.
---
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 19e68ddb49..715f39bbbf 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -2904,7 +2904,8 @@ term-emulate-terminal
(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 8aaa61a210..72a9ad1ef7 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -89,6 +89,13 @@ term-test-screen-from-input
"\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
--
2.17.1
This bug report was last modified 7 years and 73 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.