Scroll-to-last-line enabled for zooming also.
authorplugd <plugd@thelambdalab.xyz>
Sun, 18 Jul 2021 19:53:11 +0000 (21:53 +0200)
committerplugd <plugd@thelambdalab.xyz>
Sun, 18 Jul 2021 19:53:11 +0000 (21:53 +0200)
lurk.el

diff --git a/lurk.el b/lurk.el
index 8967094..6dbb8bf 100644 (file)
--- a/lurk.el
+++ b/lurk.el
@@ -452,6 +452,13 @@ portion of the source component of the message, as LURK doesn't use this.")
       (goto-char (point-max))
       (line-beginning-position))))
 
+(defun lurk-scroll-windows-to-last-line ()
+  (with-current-buffer "*lurk*"
+    (dolist (window (get-buffer-window-list))
+      (if (>= (window-point window) (lurk--start-of-final-line))
+          (with-selected-window window
+            (recenter -1))))))
+
 (defun lurk-display-string (context prefix &rest strings)
   (with-current-buffer "*lurk*"
     (save-excursion
@@ -480,11 +487,8 @@ portion of the source component of the message, as LURK doesn't use this.")
                        'face (lurk-get-context-facelist context)
                        'read-only t
                        'context context
-                       'invisible context-atom))))))
-    (dolist (window (get-buffer-window-list))
-      (if (>= (window-point window) (lurk--start-of-final-line))
-          (with-selected-window window
-            (recenter -1))))))
+                       'invisible context-atom)))))))
+  (lurk-scroll-windows-to-last-line))
 
 (defun lurk-display-message (from to text)
   (let ((context (if (eq 'channel (lurk-get-context-type to))
@@ -543,7 +547,8 @@ portion of the source component of the message, as LURK doesn't use this.")
                (remove-from-invisibility-spec this-context-atom)
              (add-to-invisibility-spec this-context-atom)))))
      lurk-context-facelists)
-    (force-window-update "*lurk*")))
+    (force-window-update "*lurk*"))
+  (lurk-scroll-windows-to-last-line))
 
 (defun lurk-zoom-out ()
   (with-current-buffer "*lurk*"
@@ -552,7 +557,8 @@ portion of the source component of the message, as LURK doesn't use this.")
        (let ((this-context-atom (if this-context (intern this-context) nil)))
          (remove-from-invisibility-spec this-context-atom)))
      lurk-context-facelists)
-    (force-window-update "*lurk*")))
+    (force-window-update "*lurk*"))
+  (lurk-scroll-windows-to-last-line))
 
 (defconst lurk-url-regex
   (rx (: