emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/coterm f44cd1f56b 2/2: Scroll snap after leaving altern


From: ELPA Syncer
Subject: [elpa] externals/coterm f44cd1f56b 2/2: Scroll snap after leaving alternate sub-buffer
Date: Mon, 28 Feb 2022 11:57:22 -0500 (EST)

branch: externals/coterm
commit f44cd1f56be39f8e05544bdc17c3ca128972ec6b
Author: Miha Rihtaršič <miha@kamnitnik.top>
Commit: Miha Rihtaršič <miha@kamnitnik.top>

    Scroll snap after leaving alternate sub-buffer
---
 coterm.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/coterm.el b/coterm.el
index 6225cbf819..271145c079 100644
--- a/coterm.el
+++ b/coterm.el
@@ -787,7 +787,15 @@ If STR contains newlines, the caller must take care that
           (forward-line 0))
         (set-marker coterm--t-home (point))
         (setq coterm--t-row (1- coterm--t-height))
-        (goto-char opoint))))))
+        (goto-char opoint)))
+
+    (cl-labels
+        ((hook ()
+           (remove-hook 'coterm-t-after-insert-hook #'hook t)
+           (unless coterm--t-alternative-sub-buffer
+             (let ((coterm-scroll-snap-mode t))
+               (coterm--scroll-snap)))))
+      (add-hook 'coterm-t-after-insert-hook #'hook nil t)))))
 
 (defun coterm--t-down-line (proc-filt process)
   "Go down one line or scroll if at bottom.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]