Skip to content

Commit bcac5b3

Browse files
JDNdeveloperkarthink
authored andcommitted
Fix gptel-auto-scroll when at end of buffer
1 parent 6abda6f commit bcac5b3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

gptel.el

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,15 +1006,13 @@ Later plists in the sequence take precedence over earlier ones."
10061006
(gptel--json-read))))
10071007

10081008
(defun gptel-auto-scroll ()
1009-
"Scroll window if LLM response continues below viewport.
1010-
1011-
Note: This will move the cursor."
1009+
"Scroll window if LLM response continues below viewport."
10121010
(when-let* ((win (get-buffer-window (current-buffer) 'visible))
10131011
((not (pos-visible-in-window-p (point) win)))
10141012
(scroll-error-top-bottom t))
10151013
(condition-case nil
10161014
(with-selected-window win
1017-
(scroll-up-command))
1015+
(run-at-time 0 nil #'scroll-up-command))
10181016
(error nil))))
10191017

10201018
(defun gptel-beginning-of-response (&optional _ _ arg)

0 commit comments

Comments
 (0)