summaryrefslogtreecommitdiff
path: root/lisp/term.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2006-06-15 22:58:10 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2006-06-15 22:58:10 +0000
commit2f182d8d513907a70ebd0d5042da0dbe0a4835dd (patch)
tree0528546a51ea4c164939aebdea423e3afc85af8a /lisp/term.el
parent8a7269eb1bdbce425ea372573e81bf7affcaa8d9 (diff)
downloademacs-2f182d8d513907a70ebd0d5042da0dbe0a4835dd.tar.gz
(term-handle-scroll, term-delete-lines)
(term-insert-lines): Fix off by one errors.
Diffstat (limited to 'lisp/term.el')
-rw-r--r--lisp/term.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/term.el b/lisp/term.el
index 8e2e0773121..8dafcfc894b 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -3613,7 +3613,7 @@ all pending output has been dealt with."))
(progn
;; Delete scroll-needed lines at term-scroll-end,
;; then insert scroll-needed lines.
- (term-vertical-motion (1- term-scroll-end))
+ (term-vertical-motion term-scroll-end)
(end-of-line)
(setq save-top (point))
(term-vertical-motion scroll-needed)
@@ -3767,11 +3767,12 @@ Should only be called when point is at the start of a screen line."
(save-current-column term-current-column)
(save-start-line-column term-start-line-column)
(save-current-row (term-current-row)))
- (when (>= (+ save-current-row lines) term-scroll-end)
- (setq lines (- lines (- (+ save-current-row lines) term-scroll-end))))
+ ;; The number of inserted lines shouldn't exceed the scroll region end.
+ (when (> (+ save-current-row lines) (1+ term-scroll-end))
+ (setq lines (- lines (- (+ save-current-row lines) (1+ term-scroll-end)))))
(term-down lines)
(delete-region start (point))
- (term-down (- term-scroll-end save-current-row lines))
+ (term-down (- (1+ term-scroll-end) save-current-row lines))
(term-insert-char ?\n lines)
(setq term-current-column save-current-column)
(setq term-start-line-column save-start-line-column)
@@ -3792,9 +3793,9 @@ Should only be called when point is at the start of a screen line."
(term-down (- term-scroll-start save-current-row))
(setq start (point)))
;; The number of inserted lines shouldn't exceed the scroll region end.
- (when (>= (+ save-current-row lines) term-scroll-end)
- (setq lines (- lines (- (+ save-current-row lines) term-scroll-end))))
- (term-down (- term-scroll-end save-current-row lines)))
+ (when (> (+ save-current-row lines) (1+ term-scroll-end))
+ (setq lines (- lines (- (+ save-current-row lines)(1+ term-scroll-end)))))
+ (term-down (- (1+ term-scroll-end) save-current-row lines)))
(setq start-deleted (point))
(term-down lines)
(delete-region start-deleted (point))