Keep point when switching from and to *terminal* buffer
* lisp/term.el (term-reset-size): Don't reset the size if it didn't change. If the size did change, restore point after adjusting the size. (Bug#24465)
This commit is contained in:
parent
21300051eb
commit
528997daa1
1 changed files with 10 additions and 6 deletions
|
@ -1116,12 +1116,16 @@ Entry to this mode runs the hooks on `term-mode-hook'."
|
||||||
(term-update-mode-line))
|
(term-update-mode-line))
|
||||||
|
|
||||||
(defun term-reset-size (height width)
|
(defun term-reset-size (height width)
|
||||||
|
(when (or (/= height term-height)
|
||||||
|
(/= width term-width))
|
||||||
|
(let ((point (point)))
|
||||||
(setq term-height height)
|
(setq term-height height)
|
||||||
(setq term-width width)
|
(setq term-width width)
|
||||||
(setq term-start-line-column nil)
|
(setq term-start-line-column nil)
|
||||||
(setq term-current-row nil)
|
(setq term-current-row nil)
|
||||||
(setq term-current-column nil)
|
(setq term-current-column nil)
|
||||||
(term-set-scroll-region 0 height))
|
(term-set-scroll-region 0 height)
|
||||||
|
(goto-char point))))
|
||||||
|
|
||||||
;; Recursive routine used to check if any string in term-kill-echo-list
|
;; Recursive routine used to check if any string in term-kill-echo-list
|
||||||
;; matches part of the buffer before point.
|
;; matches part of the buffer before point.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue