summaryrefslogtreecommitdiff
path: root/test/lisp/term-tests.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2018-06-02 15:57:33 -0400
committerNoam Postavsky <npostavs@gmail.com>2018-06-10 17:57:50 -0400
commit8a1576cc03963138d62c42bd373226e58f9f17c6 (patch)
tree21bc84d9d7a957bf211b3c8f7eed2e7b68ae972e /test/lisp/term-tests.el
parent4c3fae3cf26d2112f0744f89da93b2440cd45d56 (diff)
downloademacs-8a1576cc03963138d62c42bd373226e58f9f17c6.tar.gz
Fix term.el cursor movement at bottom margin (Bug#31690)
* lisp/term.el (term-handle-ansi-escape) <\E[B cud>: Allow moving the cursor to the bottom margin line, rather than stopping one line before.
Diffstat (limited to 'test/lisp/term-tests.el')
-rw-r--r--test/lisp/term-tests.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
index 234dfa1f0d5..7fd8d1293dc 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -124,6 +124,27 @@ line6\r
40 12 (list "\eAnSiTc /f" "oo/\n") 'default-directory)
"/foo/"))))
+(ert-deftest term-to-margin ()
+ "Test cursor movement at the scroll margin.
+This is a reduced example from GNU nano's initial screen."
+ (let* ((width 10)
+ (x (make-string width ?x))
+ (y (make-string width ?y)))
+ (should (equal (term-test-screen-from-input
+ width 3
+ `("\e[1;3r" ; Setup 3 line scrolling region.
+ "\e[2;1H" ; Move to 2nd last line.
+ ,x ; Fill with 'x'.
+ "\r\e[1B" ; Next line.
+ ,y)) ; Fill with 'y'.
+ (concat "\n" x "\n" y)))
+ ;; Same idea, but moving upwards.
+ (should (equal (term-test-screen-from-input
+ width 3
+ `("\e[1;3r" "\e[2;1H" ,x "\r\e[1A" ,y))
+ (concat y "\n" x)))))
+
+
(provide 'term-tests)
;;; term-tests.el ends here