summaryrefslogtreecommitdiff
path: root/lisp/term.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/term.el')
-rw-r--r--lisp/term.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/term.el b/lisp/term.el
index 419ddb2db5c..60cd547f93d 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -3387,11 +3387,10 @@ option is enabled. See `term-set-goto-process-mark'."
;; \E[B - cursor down (terminfo: cud)
((eq char ?B)
(let ((tcr (term-current-row)))
- (unless (= tcr (1- term-scroll-end))
+ (unless (>= tcr term-scroll-end)
(term-down
- (if (> (+ tcr term-terminal-parameter) term-scroll-end)
- (- term-scroll-end 1 tcr)
- (max 1 term-terminal-parameter)) t))))
+ (min (- term-scroll-end tcr) (max 1 term-terminal-parameter))
+ t))))
;; \E[C - cursor right (terminfo: cuf, cuf1)
((eq char ?C)
(term-move-columns