File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1009,13 +1009,14 @@ Later plists in the sequence take precedence over earlier ones."
10091009 " Scroll window if LLM response continues below viewport.
10101010
10111011Note: This will move the cursor."
1012- (when-let* ((win (get-buffer-window (current-buffer ) 'visible ))
1013- ((not (pos-visible-in-window-p (point ) win)))
1014- (scroll-error-top-bottom t ))
1015- (condition-case nil
1016- (with-selected-window win
1017- (run-at-time 0 nil #'scroll-up-command ))
1018- (error nil ))))
1012+ (run-at-time ; Scheduled on the event loop to call from outside save-excursion
1013+ 0 nil (lambda ()
1014+ (when-let* ((win (get-buffer-window (current-buffer ) 'visible ))
1015+ ((not (pos-visible-in-window-p (point ) win)))
1016+ (scroll-error-top-bottom t ))
1017+ (condition-case nil
1018+ (with-selected-window win (scroll-up-command ))
1019+ (error nil ))))))
10191020
10201021(defun gptel-beginning-of-response (&optional _ _ arg )
10211022 " Move point to the beginning of the LLM response ARG times."
You can’t perform that action at this time.
0 commit comments