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

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

[elpa] externals/ellama 5f33a4837d 2/3: Merge pull request #137 from s-k


From: ELPA Syncer
Subject: [elpa] externals/ellama 5f33a4837d 2/3: Merge pull request #137 from s-kostyaev/fix-autoscroll
Date: Mon, 8 Jul 2024 15:58:04 -0400 (EDT)

branch: externals/ellama
commit 5f33a4837dfa16e8681cdba257d0d7aaf6cbaac9
Merge: b2ebd3ccfb 318683be00
Author: Sergey Kostyaev <s-kostyaev@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #137 from s-kostyaev/fix-autoscroll
    
    Fix autoscrolling for editing commands
---
 ellama.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/ellama.el b/ellama.el
index 2165ea1ebd..c129589d86 100644
--- a/ellama.el
+++ b/ellama.el
@@ -1209,6 +1209,11 @@ If EPHEMERAL non nil new session will not be associated 
with any file."
              prompt)
     prompt))
 
+(defun ellama-chat-buffer-p (buffer)
+  "Return non-nil if BUFFER is an ellama chat buffer."
+  (with-current-buffer buffer
+    (not (not ellama--current-session))))
+
 (defun ellama-stream (prompt &rest args)
   "Query ellama for PROMPT.
 ARGS contains keys for fine control.
@@ -1283,9 +1288,10 @@ failure (with BUFFER current).
                    (goto-char pt))
                  (when-let ((ellama-auto-scroll)
                             (window (get-buffer-window buffer)))
-                   (with-selected-window window
-                     (goto-char (point-max))
-                     (recenter -1)))
+                   (when (ellama-chat-buffer-p buffer)
+                     (with-selected-window window
+                       (goto-char (point-max))
+                       (recenter -1))))
                  (undo-amalgamate-change-group ellama--change-group)))))
        (setq ellama--change-group (prepare-change-group))
        (activate-change-group ellama--change-group)



reply via email to

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