aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2018-04-17 19:17:18 -0400
committerNoam Postavsky2018-04-18 07:33:27 -0400
commitb89ff0efdb65e9febe4c3ed2586a48a2b42233aa (patch)
tree48df43e55ab689afffcbf818a770f747e85a4eb3
parent326a296fed986a01677d7c2a37557f5589f5f7d2 (diff)
downloademacs-b89ff0efdb65e9febe4c3ed2586a48a2b42233aa.tar.gz
emacs-b89ff0efdb65e9febe4c3ed2586a48a2b42233aa.zip
Don't assume term-current-row cache is valid (Bug#31193)
* lisp/term.el (term-down): Call `term-current-row' instead of directly accessing the variable `term-current-row. Following a resize of the terminal's window, `term-current-row' is reset to nil, so it is not safe to assume it is a number.
-rw-r--r--lisp/term.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/term.el b/lisp/term.el
index 0a5efa4abc9..6860ea69342 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -3764,7 +3764,7 @@ all pending output has been dealt with."))
3764 (let ((start-column (term-horizontal-column))) 3764 (let ((start-column (term-horizontal-column)))
3765 (when (and check-for-scroll (or term-scroll-with-delete term-pager-count)) 3765 (when (and check-for-scroll (or term-scroll-with-delete term-pager-count))
3766 (setq down (term-handle-scroll down))) 3766 (setq down (term-handle-scroll down)))
3767 (unless (and (= term-current-row 0) (< down 0)) 3767 (unless (and (= (term-current-row) 0) (< down 0))
3768 (term-adjust-current-row-cache down) 3768 (term-adjust-current-row-cache down)
3769 (when (or (/= (point) (point-max)) (< down 0)) 3769 (when (or (/= (point) (point-max)) (< down 0))
3770 (setq down (- down (term-vertical-motion down))))) 3770 (setq down (- down (term-vertical-motion down)))))
@@ -3774,7 +3774,7 @@ all pending output has been dealt with."))
3774 (setq term-current-column 0) 3774 (setq term-current-column 0)
3775 (setq term-start-line-column 0)) 3775 (setq term-start-line-column 0))
3776 (t 3776 (t
3777 (when (= term-current-row 0) 3777 (when (= (term-current-row) 0)
3778 ;; Insert lines if at the beginning. 3778 ;; Insert lines if at the beginning.
3779 (save-excursion (term-insert-char ?\n (- down))) 3779 (save-excursion (term-insert-char ?\n (- down)))
3780 (save-excursion 3780 (save-excursion